SLR14 -Data structures Flashcards

1
Q

What does contiguous mean in regards to arrays

A

All data is stored in the same place

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

Describe the features of arrays

A

Static
Contiguous
Homogenous - only support a single data type

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

Describe a record data structure

A

A collection of connected fields similar to a database or dictionary

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

What are the 3 steps of using a record structure

A

Define the fields in the record
Declare a variable or array to use with it
Assign and retrieve data from the record

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

Describe a tuple

A

A immutable list that can store multiple data types and cannot change after runtime

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

What is the difference between lists and arrays

A

Lists can store multiple data types whereas arrays can only store 1

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

What does static mean

A

Size cannot change after runtime

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

What does immutable mean

A

Structure/data cannot be changed after runtime

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

What is a stack

A

A data structure where items are both added and removed from the top of the list

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

What does LIFO mean

A

Last in first out

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

What does FIFO mean

A

Fist in first out

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

What are the 3 operations that can be performed on a stack

A

Push
Pop
Peak

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

What is a queue

A

A data structure where items are added to the back of the list and removed from the front

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

Which position can you “peek” to when using a queue data structure

A

The front

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

Describe the stages of adding data to a stack

A

Check if there is room
Increment the stack pointer
Insert the new item at the position of the stack pointer

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