1.4.2 Data structures - Arrays Flashcards

(10 cards)

1
Q

Define an array

A
  1. a static, mutable, ordered collection of items
  2. items can be changed or replaced
  3. can only store one data type
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define a list

A
  1. a dynamic, mutable, ordered collection of items
  2. items can be changed or replaced
  3. can store more than one data type
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Define a tuple

A
  1. a static, immutable, ordered collection of items
  2. items cannot be changed or replaced
  3. can store more than one data type
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Define a linear array

A

A one-dimensional array

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

How can you visualise a two-dimensional array?

A
  1. as a spreadsheet
  2. a table with two sets of indexes (one for rows and one for columns)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can you visualise a three dimensional array?

A

As a multi-page spreadsheet

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

Define a record data structure

A
  1. a collection of related fields
  2. a field is a variable
  3. each field in a record can have a different data type
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How many data types can arrays support?

A

A single data type (homogeneous)

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

Differences between arrays and lists

A
  1. lists can store data non-continuously whereas arrays store data in order
  2. lists can store data of more than one data type
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Difference between tuples and arrays

A
  1. tuples are initialised with regular brackets
  2. arrays are initialised with square brackets
How well did you know this?
1
Not at all
2
3
4
5
Perfectly