1.4.2 Data structures Flashcards
what is an array?
an ordered, finite set of elements of a single type
what is a list?
a data structure consisting of a number of items, where the items can occur
more than once
what is a stack?
a last in first out data structure, where items can only be removed from and added to the top of the list
what is a queue?
a first in first out data structure, where items are added to the end of the queue and removed from the front of the queue
what does the operation isEmpty() do?
checks to see if the stack is empty
what does the operation push(value) do?
adds a new value to the top of the stack
what does the operation peek() do?
returns the top value of the stack
without removing it
what does the operation pop() do?
returns and removes the value at the top of the stack
what does the operation size() do?
it returns the size of the stack
what does the operation isFull() do?
checks to see if the stack is full
what does the operation
enQueue(value) do?
adds the value to the end of the queue
what does the operation deQueue() do?
removes the item from the end of the queue
what does the operation isEmpty() do?
it checks to see if the queue is empty