SLR14 Flashcards
What’s are the characteristics of Lists as a data type
- mutable
- ordered collection of items
- items can be changed or replaced
- can store more than one data type
What’s are the characteristics of an array as a data type
- mutable
- ordered collection of items
- items can be changed or replaced
- can only store one data type
What’s are the characteristics of a Tulpe as a data type
- immutable
- unordered collection of items
- items cannot be changed or replaced
- can store more than one data type
What’s are the characteristics of a record as a data type
- mutable
- ordered collection of items
- items can be changed or replaced
- can store more than one data type
What does LIFO stand for
Last In First Out
What structure do stacks function in
LIFO
How many pointers does a stack have a where are they?
One and the top node
What happens when you try to remove an item from an empty stack
Underflow error
What happens when trying to add an item to a full stack
An overflow error
What are stacks used for
- user inputs
- back tracking algorithms
- evaluating mathematical equations without brackets
What are the three operations of a stack
- push
- pop
- peek
What does the push operation do in a stack
Adds a new item to the top of a stack
What does the pop operation do in a stack
Removes the top item off of the stack
What does the peek operation do in a stack
Returns the value of the top item in a stack without removing or deleting it
What is the process of enqueuing in an array
Adding an item to the back of a queue
What is the process of dequeuing in an array
Removing the item from the front of the queue
What will happen if you try and remove an item from an empty queue in an array
An underflow error
What will happen if you try an add an item to a full queue in an array
An overflow error
In what way does a queue in an array operate
FIFO
What does FIFO stand for
First In First Out
What does FIFO stand for
First In First Out
What are the three operations in a queue in an array
- enqueue
- dequeue
- peek
What is the process of enqueuing in an array
Adding an item to the back of a queue
What is the process of dequeuing in an array
Removing an item from the from of a queue
What is the process of peeking in a queue in an array
Returning the value of the item at the front of the queue without removing or deleting it
What type of data structure is a queue
A linear data structure
As Queues are a FIFO structure what does this allow us to do that you can’t do with a stack
Add priority
What does priority do
Allows items to skip the queue or part of the queue based on there importance
How many pointers does a queue have and where are they
Two and at the back and the front
Where can queues be implemented
- in an array
- Object-Orientated Programming