Lists, tuples arrays and records(1.4.2 a) Flashcards

1
Q

What are compound data types?

A

allows us to store multiple pieces of data in one place

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

What are arrays?

A

ordered collection of elements of all the same type and a fixed length

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

Arrays

A

good for storing lots of data in a single place
can access each individual element
can update each element
can’t add or remove elements once defined

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

What is a 2 dimensional array?

A

store an array in another array

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

What are lists?

A

mutable ordered collection of items of any type with a finite length

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

What is mutable?

A

able to be changed

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

Lists

A

access any length
change an item
add or delete an item
test if the list is empty
access the first and last item

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

What are tuples?

A

like lists except they cannot be modified after definied

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

Tuples

A

explicitly read only
faster to access than lists due to reduced set of possible actions

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

What is a record?

A

fixed collection of fields of any type that is a finite length

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

What is dynamic?

A

the size can change at runtime

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

What is static?

A

the size cannot change at runtime

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

Arrays static or dynamic?

A

static

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

Lists static or dynamic?

A

dynamic

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

Records static or dynamic?

A

dynamic/static

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

Tuples static or dynamic?

A

static/dynamic