Data Structures Flashcards

1
Q

What is an array?

A

A set of ordered elements with fixed length.

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

What is a tuple?

A

A set of ordered values which could be different data types, elements cannot be changed.

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

What is a record?

A

A row in a database.

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

What is a queue?

A

A FIFO data structure - elements are removed in the order they are added.

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

What is a dynamic data structure?

A

One which does not have a fixed size.

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

What is a linked list?

A

A list of data where each piece of data contains a pointer to the location of the next.

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

What is a stack?

A

A LIFO data structure - the last element added is the first to come out.

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

What would cause an underflow on a stack?

A

Trying to pop an item when the stack is empty.

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

What is a hash table?

A

A data structure where the location of an item is given by a hash of its value.

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

What is a dictionary?

A

Where a value and key are stored together, passing the key returns the value.

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

What is a graph?

A

A set of nodes and vertices.

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

What are the two methods of implementing a graph?

A

An adjacency matrix and an adjacency list.

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

What is an adjacency matrix?

A

A 2d array with the nodes giving the x-y coords such that giving two nodes returns the distance between them.

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

What is an adjacency list?

A

Where each node has a list of all the nodes connected to it and their weights.

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

What is a depth first graph traversal?

A

Where you go as far down a route as possible before backtracking when hitting a dead end, uses a stack.

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

What is breadth first graph traversal?

A

All neighbours of the node are visited before continuing, uses a queue.

17
Q

What is a tree?

A

A graph where each node is connected by up to exactly one arc.