Data Structures Flashcards
What is an array?
A set of ordered elements with fixed length.
What is a tuple?
A set of ordered values which could be different data types, elements cannot be changed.
What is a record?
A row in a database.
What is a queue?
A FIFO data structure - elements are removed in the order they are added.
What is a dynamic data structure?
One which does not have a fixed size.
What is a linked list?
A list of data where each piece of data contains a pointer to the location of the next.
What is a stack?
A LIFO data structure - the last element added is the first to come out.
What would cause an underflow on a stack?
Trying to pop an item when the stack is empty.
What is a hash table?
A data structure where the location of an item is given by a hash of its value.
What is a dictionary?
Where a value and key are stored together, passing the key returns the value.
What is a graph?
A set of nodes and vertices.
What are the two methods of implementing a graph?
An adjacency matrix and an adjacency list.
What is an adjacency matrix?
A 2d array with the nodes giving the x-y coords such that giving two nodes returns the distance between them.
What is an adjacency list?
Where each node has a list of all the nodes connected to it and their weights.
What is a depth first graph traversal?
Where you go as far down a route as possible before backtracking when hitting a dead end, uses a stack.