Stacks and Queues

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/14

flashcard set

Earn XP

Description and Tags

Flashcards about Stacks and Queues.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

15 Terms

1
New cards

Arrays

Length fixed at time of allocation, data stored densely, supported as Python type.

2
New cards

Linked Lists

Length depends on elements, data stored as pair of data and reference(s), supported as Python collection.

3
New cards

Stack

Examine the item most recently added; LIFO (last in first out).

4
New cards

Queue

Examine the item least recently added; FIFO (first in first out).

5
New cards

Interface

A description of data type and basic operations.

6
New cards

Client

Program using operations defined in interface.

7
New cards

Implementation

Actual code implementing operations.

8
New cards

Last In First Out

What does LIFO stand for?

9
New cards

First In First Out

What does FIFO stand for?

10
New cards

pop()

Remove and return the element most recently added.

11
New cards

push(obj: item)

Insert a new element onto the stack.

12
New cards

How to implement a Stack with a Singly-Linked list?

Maintain pointer first to first node in a singly-linked list to pop item from first and push new item before first.

13
New cards

Underflow

Throw exception if pop from an empty stack.

14
New cards

Loitering

Holding a reference to an object when it is no longer needed.

15
New cards

push() with resize by 1

Increase size of array data[ ] by 1.