2.3.1 Flashcards
What structure are stacks?
FILO
Which function adds an item to a stack
Push
Which function removes an element from a stack
Pop
What does the back pointer in a queue do?
Holds the location of the next available space in the queue
Which function returns the item at the front of a queue without removing it
Peek
What is the purpose of the front pointer in a queue
Points to the space containing the first item in the queue
What value is the top pointer of a stack initialised as
-1
Pseudocode to add an item to a stack
push(element)
top += 1
A[top] = element
Pseudocode to add an item to a queue
enqueue(element)
A[back] = element
back += 1
What is a procedural programming language
High-level language
Gives a series of instructions in a (logical)
order / line by line / what to do and how to
do it