MODULE 2: Stack

0.0(0)
studied byStudied by 2 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/8

flashcard set

Earn XP

Description and Tags

Prelim Topic

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

9 Terms

1
New cards

Stack

  • A stack is a way to group things together by placing one thing on top of another and then removing things one at a time from the top of the stack.

2
New cards

Stack

  • In computer science, a stack is a Last-in, First-Out (L I F O) abstract data type and data structure. A stack can have any abstract data type as an element but is characterized by only two fundamental operations: push and pop.

3
New cards

push()

(Basic Operations on Stack)

  • To insert an element into the stack

4
New cards

pop()

(Basic Operations on Stack)

  • To remove an element from the stack

5
New cards

top()

(Basic Operations on Stack)

  • Returns the top element of the stack

6
New cards

isEmpty()

(Basic Operations on Stack)

  • returns true if the stack is empty, if not, false

7
New cards

Size()

(Basic Operations on Stack)

  • Returns the size of the stack

8
New cards

peek()

(Basic Operations on Stack)

  • Is a method that looks at the item at the top of the stack

9
New cards

search()

(Basic Operations on Stack)

  • Is a method that returns the position (in number) of an item from the top of a stack