data structures Flashcards
array
an ordered, finite set of elements of a single type
record
a set of fields of different data types of a fixed size
list
a data structure consisting of a number of items
list vs array
lists can store data non-contiguously
lists can store more than one data type
tuple
an immutable, ordered set of values of any time
stack
a LIFO abstract data type
stacks - uses
back button in a web page, undo buttons, memory management for subroutines
queue
a FIFO abstract data type
stacks: push(value)
adds a new value to the top of the stack
stacks: peek()
returns the top value of the stack without removing it
stacks: pop()
returns and removes the value at the top of the stack (end of the list)
queue: enQueue(value)
adds the value to the end of the queue
queue: deQueue()
removes the item from the end of the queue