Week 7 Flashcards
1
Q
What is a data structure?
A
A means of organising many data items into an aggregate
2
Q
What is an array?
A
A collection of data where every element has the same type
3
Q
How is an array stored in memory?
A
It’s held as a sequence of words in memory, with consecutive addresses
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
5
Q
What is the effective address?
A
X[i] has address X+i
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.