Chapter 8.2 - Arrays Flashcards
1
Q
Define an array
A
data structure containing several elements of the same data type
2
Q
what is an index
A
identifies the position of an element in an array
3
Q
how to declare a one dimension array in pseudocode
A
DECLARE MyList : ARRAY[0:9] OF INTEGER
4
Q
2 ways to populate a list in psuedocode
A
MyList[4] ← 27
or user input:
OUTPUT “Enter next value “
INPUT MyList[Counter]
5
Q
First index of arrays in python and psuedocode
A
python - 0
pseudo - 0
6
Q
How to declare a 2D array in psuedocode
A
DECLARE MyTable : ARRAY[0:9,0:2] OF INTEGER
7
Q
psuedocode
in List[x, y]
what is x?
what is y?
how to write this in python
A
x - row
y - column
List[x][y]