Stacks Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a stack?

A

An abstract data type that holds an ordered linear sequence of items

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

What structure does a stack follow?

A

LIFO (Last in fist out)

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

What does push(data) do?

A

Adds an element to the top of a stack

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

What does pop() do?

A

Removes an element from the top of the stack

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

What does peek() do?

A

Returns a copy of the top element of a stack without removing it

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

What does is_empty do?

A

Checks whether a stack is empty

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

What does is_full do?

A

Checks whether a stack is at maximum capacity when stored is static

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

What are stacks main operations?

A

pushing items onto and popping items off the stack

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

What causes a stack overflow?

A

Continuously adding items to an statically implemented array

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

What is needed to implement dynamic stacks?

A

Linked lists, additional tracking variables

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