4.2 Data Structures Flashcards

1
Q

What is an array?

A

A data structure that consists of an ordered, finite set of elements of a single data type.

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

What are 3 properties of arrays?

A

Data is stored contiguously in memory for efficient access

mutable - content can be changed

static - size can’t be changed after the array is declared

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

What is a record?

A

A collection of related attributes/fields under a single identifier.

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

What is a property of records?

A

mutable - the content can be changed

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

What is a list?

A

A data structure that consists of an ordered, finite set of elements of any data type.

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

What are 2 properties of lists?

A

dynamic - size can be changed after declaration

mutable - content can be changed

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

What is a tuple?

A

An immutable, static data structure used to store an ordered, finite set of elements of any data type.

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

What is a linked list?

A

An abstract data structure that consists of nodes that each contain data and a pointer that is the address of the next node in the list.

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

What are the 3 pointers?

A

null pointer for end of list

start pointer to first node in list

next free pointer to next available node in list

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

What is a graph?

A

An abstract data structure comprising of nodes and edges. Edges can have weights (costs) and directions and connect nodes together.

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

What is a stack?

A

An abstract static data structure where the last item in is the first item out.

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

What pointer do you need for a stack?

A

A pointer to the top item in the stack.

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

What is a queue?

A

An abstract data structure where the first item in is the first item out.

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

What pointers do you need for a queue?

A

a front and rear pointer

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

What is a tree?

A

A hierarchical abstract data structure with a root node and child nodes and branches that connect parent nodes to child nodes.

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

What is a binary search tree?

A

A tree where each node can have up to 2 child nodes.

17
Q

What is a hash table?

A

An abstract data structure where a hash function is applied onto the data to produce a hash. This hash is the address in the hash table where the data is stored.