1.4.2 Data Structures Flashcards

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

What is an array?

A

A finite set of ordered elements of the same data type.

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

What is a tuple?

A

An ordered set of elements of any data type. It is immutable meaning it cannot be changed.

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

What is a list?

A

A set of ordered items of any type which can appear more than once. Stored non-contiguously.

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

What is a linked list?

A

A dynamic data structure used to hold an ordered sequence. Each item contains an index, a data field, and a pointer to the next index.

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

What is a graph? How can they be processed?

A

A set of nodes connected by edges.

Adjacency matrix or adjacency list.

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

What is an adjacency matrix? What are its advantages?

A

A table containing all of the possible connections in a graph.

Advantages => Easy to add nodes, quick access times.

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

What is an adjacency list? What are its advantages?

A

A list that contains all of the links between nodes.

Advantages => More space efficient for larger graphs.

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

What is a stack? Examples?

A

A First In Last Out / Last In First Out data structure.

E.g. Undo operation.

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

What is a tree?

A

A connected form of graph. Binary trees have a maximum of 2 children and can be used for binary searches.

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

What is a queue? Examples?

A

A First In First Out data structure.

E.g. printers, keyboards.

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

What is a hash?

A

A result generated by applying an algorithm to a value.

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

What is a hash table?

A

An array used with a hash function, which determines the index of the array to use.

A good hash function should have a low probability of collisions.

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