stacks and queues Flashcards

1
Q

What is a stack?

A

A LIFO (‘last in first out’) data structure, where items can only be removed from and added to the top of the list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Give an example of where stacks may be used.

A
  • Back button in a web page
  • Undo buttons
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a queue?

A

A FIFO (‘first in first out’) data structure, where items are added to the end of the queue and removed from the front of the queue.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly