Deck 4: Stacks & Queues

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/13

encourage image

There's no tags or description

Looks like no tags are added yet.

14 Terms

1
New cards

What is a Stack?

An ADT following LIFO.

2
New cards

What does LIFO mean?

Last In First Out.

3
New cards

Operation used to add to a stack?

push()

4
New cards

Operation used to remove from a stack?

pop()

5
New cards

Operation used to inspect the top of a stack?

peek()

6
New cards

Common real-world use of a stack?

Undo functionality.

7
New cards

What is a Queue?

An ADT following FIFO.

8
New cards

What does FIFO mean?

First In First Out.

9
New cards

Queue insertion operation?

enqueue()

10
New cards

Queue removal operation?

dequeue()

11
New cards

Queue inspection operation?

first()

12
New cards

What is a Circular Queue?

A queue where the rear wraps around to the beginning.

13
New cards

Circular queue formula?

(rear + 1) % queue.length

14
New cards

What is a Priority Queue?

Elements are removed according to priority rather than arrival order.