Lesson 4: Stacks Flashcards

1
Q

data structure in which all insertions and deletions are restricted to one end, called the top

A

Stacks

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

Is Stack LIFO (last-in, first-out) or FIFO (first-in, first-out)?

A

LIFO

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

Basic Stack Operations (clue: PPS)

A

Push
Pop
Stack Top (TopMost)

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

[Basic Stack Operations] Used to insert a new element at the top of the stack

A

Push

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

[Basic Stack Operations] Problem in Push

A

Overflow

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

[Basic Stack Operations] Removes the element at the top of the stack and returns the data to the calling module

A

Pop

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

[Basic Stack Operations] Problem with Pop

A

Underflow

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

[Basic Stack Operations] Returns the data at the top of the stack without deleting the data from the stack.

A

Stack Top (TopMost)

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

[Basic Stack Operations] Problem with Stack Top (TopMost)

A

Underflow

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

Two Structures to Implement Stack (clue: HD)

A

Head
Data node

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

[Two Structures to Implement Stack] Contains metadata

A

Head

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

[Two Structures to Implement Stack] Head requires only two attributes, which are? (clue: TC)

A

Top pointer
Count of the number of elements in the deck

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

Stack Algorithms (clue: CPPSEFSD)

A

Create stack
Push stack
Pop stack
Stack top
Empty stack
Full stack
Stack count
Destroy stack

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

[Stack Algorithms] sends the data at the top of the stack back to the calling module without deleting the top node. It allows the user to see what will be deleted when the stack is popped

A

Stack top algorithm

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

[Stack Algorithms] Provided to implement the structured programming concept of data hiding

A

Empty Stack

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

[Stack Algorithms] Structured programming implementation of data hiding

A

Full Stack

17
Q

[Stack Algorithms] The most difficult algorithms to implement depending on the language

A

Full Stack

18
Q

[Stack Algorithms] Returns the number of elements currently in the stack

A

Stack Count

19
Q

[Stack Algorithms] Deletes all data in a stack

A

Destroy Stack

20
Q

Stack Applications (clue: RPBP)

A

Reversing data
Parsing
Backtracking
Postponing

21
Q

[Stack Applications] We can use stacks to reverse data

A

Reversing Data

22
Q

[Stack Applications] Stacks can be used to backtrack to achieve certain goals

A

Backtracking

23
Q

[Stack Applications] Evaluating arithmetic expressions

A

Postponement

24
Q

In high level languages, _____ notation cannot be used to evaluate expressions

A

Infix

25
Q

What notation is this: +ab

A

Prefix

26
Q

What notation is this: a+b

A

Infix

27
Q

What notation is this: ab+

A

Postfix