121 Week 8 - Stack and Linked Lists Flashcards

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

Stack

A

An abstract data type which holds a collection of items in the order in which they were added. It is a Last in First out data type meaning items are added to and removed from the top of the stack.

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

Stack functions

A

Push - add an item to the top of the stack
pop - remove the item on top of the stack and return its value.
Empty - return true if the stack has no items, else return false

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

Underflow

A

Trying to pop from an empty stack

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

Overflow

A

In bounded stacks, trying to push an item when the stack is full

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

Applications of a stack

A

Call stack for program execution
Syntax and semantics of programming languages
Depth first searching algorithms

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

List

A

An abstract data type that stores a set of items in a linear order. It cannot have duplicates

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

Singly linked list

A

A list where elements contain a value and a pointer to the next item in the list

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

Doubly linked list

A

A list where elements contain a value and a pointer to the next item in the list and previous item in the list.

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