Week 7 Flashcards

1
Q

What is a data structure?

A

A means of organising many data items into an aggregate

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

What is an array?

A

A collection of data where every element has the same type

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

How is an array stored in memory?

A

It’s held as a sequence of words in memory, with consecutive addresses

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

How do we create an array in memory?

A

We need to allocate space for every element. If there are 4 elements, you need four DATA statements even if no initial values.

  • only the first element of the array gets a label.
  • say for example X is the label of the array, then X is the base address
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the effective address?

A

X[i] has address X+i

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

What happens if an address is not within the range 0 to 65535?

A

It will overflow and come back lower than the base address we started with.

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