Chapter 2 Flashcards
are linear data structures that follow a particular order to add or remove entities.
Stacksandqueues
is an Abstract Data Type (ADT)
stack
Pushing (storing) an element on the stack.
Push()
Removing (accessing) an element from the stack. When data is PUSHed onto stack.
pop()
get the top data element of the stack, without removing it.
Peek()
check if stack is full.
isFull()
check if stack is empty.
isEmpty()
The process of putting a new data element onto stack is known as a
Push Operation
Accessing the content while removing it from the stack, is known as a
Pop Operation
A queue is a lot like a stack.
are open from both ends: one end for inserting data, and the other end for removing data
Queues
is only open from one end.
stack
add (store) an item to the queue.
enqueue()
remove (access) an item from the queue.
dequeue()
provides top value of the stack without actually removing it.
top