Fundamentals of Data Structures Flashcards
How many pointers do linear queues have?
Two: Front and rear
What is FIFO?
First in, first out
What does LIFO mean?
Last in, first out
What data structures are queues based on?
Arrays
Which abstract data structure uses FIFO?
Stacks
Which abstract data structure uses LIFO?
Queues
What is an abstract data structure?
Data structures that don’t exist as data structures in their own right, they make use of other data structures to form a new way of storing data
What is an array?
A finite, indexed set of related elements of the same data type
If two items in a priority queue have the same priority, what order are they removed in?
FIFO
A = [4,5]
B = [5,3]
What is ab?
(4x5) + (5x3) = 35
What procedure adds an item onto a stack?
Push
What procedure removes an item from a stack?
Pop
How many pointers do stacks have?
One: at the top
What is best suited for dense graphs:
Adjacency matrices or adjacency lists?
Adjacency matrices