Karteikarten
data structures trees etc
Karten in diesem Stapel (19)
- 1what is an arraya variable containing more than one item
finite ordered set of elements of same data type
they start at index 0 - 2what is the programming structure for array that are multi dimensionalfor 2D arrays
variableARRay= ("" for fields in range(x) for records in range (x))
for fields, sets the number of column, for records sets number of rows
then
countries( whatever coordinates with index starting zero) in a list
for 3D arrays: - 3how to reference any item in a 1D arrayjust output(variable-index)
- 4whats the difference between static and dynamic data structurea data structure is dynamic if it can be changed at runtime and static if it cant be changed at run time
- 5what is a linked lisa linked list is a data structure that provides a foundation upon which other structures can be built like stacks graphs queues trees.
it is constructed from nodes and pointers - 6what is a start pointeta start pointer identifies the first node
- 7what is a stacka data structure where data is place on top of each other and data is added to and removed from the top
- 8what is pushing and poppingpushing is the process of adding data onto top of the stack. eg 77 is pushed onto stack
popping is the process of removing item from top of stack, eg 53 is popped off stack - 9how to write algorithm for stack Push(check if stack is full) If stack pointer is maximum then output stack overflow
set stackPointer to stackpointer+1
set stack(stackpointer to) data
endif - 10how to write algorithm for pop stackcheck if stack is empty
if stack pointer is minimum then output stack underflow
else
set data to stackpointer
set stackpointer to -1
end if - 11what structure is a stack known asLIFO
last item push onto stack is first item popped off stack - 12whats is a stack pointer and stack over/underflowa stack pointer points to points to the top of the top node
stack overflow is an attempt to push item onto full stack
underflow is pop item off empty stack - 13stack useskeeping track of user input for undo operations
- 14how to select specific number of characters in psuedo when collecting from stringsstart with indicating from left or from right then bracket then variable name then comma then number of characters
- 15how to input in or string or int psuedodeclare Variable as int or str
VARIABLE = input( or input( - 16what is a queuea queue is a linear structure where items are added at the back of the queue and removed at the front
first in first out - 17what is the algorithm for adding item onto a queuecheck if queue is full.
if queue start pointer is 1 and queue end pointer is maximum
output queue overflow
else
add data to endpointer +1
endif - 18algorithm for removing item from queuecheck if empty.
if start pointer = 0 then output underflow
else:
data = queue(startpointer)
startpointer= +1 - 19what is a tree?a tree is a data structure with nodes and pointers. root is at top
Informationen
- Beschreibung
- Highers computing (semester 1) Karteikarten am data structures trees etc, erstellt von Daniel Nnajiuba am 29/08/2022.
- Erstellt von
- Daniel Nnajiuba
- Aufrufe
- 0
- Bewertung