Chapter 6: Stack Implementations

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

1/32

flashcard set

Earn XP

Description and Tags

This set of flashcards covers key terms and definitions related to stack implementations in data structures, particularly focusing on linked, array-based, and vector-based stacks.

Last updated 6:50 PM on 2/19/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

33 Terms

1
New cards

Linked Stack

A stack implementation where entries are stored in a chain of nodes.

2
New cards

push()

A method that adds a new entry to the top of the stack.

3
New cards

pop()

A method that removes and returns the top entry from the stack.

4
New cards

peek()

A method that returns the top entry without removing it from the stack.

5
New cards

isEmpty()

A method that checks if the stack is empty.

6
New cards

clear()

A method that removes all entries from the stack.

7
New cards

Node

A data structure that contains an entry and a reference to the next node.

8
New cards

topNode

A reference to the first node in the linked stack.

9
New cards

EmptyStackException

An exception thrown when an operation is attempted on an empty stack.

10
New cards

Array-Based Stack

A stack implementation where entries are stored in a dynamic array.

11
New cards

integrityOK

A boolean flag indicating the integrity of a stack.

12
New cards

DEFAULT_CAPACITY

The default initial capacity of the stack.

13
New cards

MAX_CAPACITY

The maximum capacity allowed for the stack.

14
New cards

topIndex

The index of the top entry of the stack in an array-based implementation.

15
New cards

ensureCapacity()

A method to double the size of the array if it is full.

16
New cards

stack[]

An array that holds the entries in an array-based stack.

17
New cards

checkIntegrity()

A method to verify the integrity of the stack.

18
New cards

Vector

A class that behaves like a high-level array, resizing as needed.

19
New cards

VectorStack

A stack implementation where entries are stored in a vector.

20
New cards

lastElement()

A method that returns the last entry in a vector.

21
New cards

add()

A method to add an entry to the vector-based stack.

22
New cards

remove()

A method to remove and return an entry from the vector by index.

23
New cards

clear() (in VectorStack)

A method that clears all entries in the vector.

24
New cards

checkCapacity()

A method to verify and adjust the capacity of the stack.

25
New cards

push() (in VectorStack)

Method to add an entry to the top of a vector-based stack.

26
New cards

pop() (in VectorStack)

Method to remove the last entry from a vector-based stack.

27
New cards

Node Class

A nested class used to represent each node in a linked stack.

28
New cards

LinkedStack

A generic class for a linked stack implementation.

29
New cards

ArrayStack

A generic class for an array-based stack implementation.

30
New cards

Data Structure

A way to organize and store data for efficient access and modification.

31
New cards

ADT (Abstract Data Type)

A model for data structures defined by their behavior from the point of view of a user.

32
New cards

O(1) operation

An operation that takes constant time, regardless of the size of the data structure.

33
New cards

push operation complexity

The complexity of the push operation is generally O(1) in both linked and array-based stacks.