Chapter 8.2 - Arrays Flashcards

1
Q

Define an array

A

data structure containing several elements of the same data type

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

what is an index

A

identifies the position of an element in an array

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

how to declare a one dimension array in pseudocode

A

DECLARE MyList : ARRAY[0:9] OF INTEGER

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

2 ways to populate a list in psuedocode

A

MyList[4] ← 27

or user input:

OUTPUT “Enter next value “
INPUT MyList[Counter]

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

First index of arrays in python and psuedocode

A

python - 0
pseudo - 0

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

How to declare a 2D array in psuedocode

A

DECLARE MyTable : ARRAY[0:9,0:2] OF INTEGER

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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]

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