5. Arrays Flashcards

(8 cards)

1
Q

Array

A
  • A special variable having one name, but storing a list of data items, with each item being directly accessible
  • Each item in an array is known as an element
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Index

A

In an array, each element’s location number is called the index

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

Array Variable

A

an ordered list of items of a given data type and size

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

Element

A

Each item in an array

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

Scalar Variable

A

a single-item (non-array) variable

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

[ ] are brackets
{ } are braces
( ) are parentheses

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

for i = userInts.size - 1; i >= 0; i = i - 1

A

Go through array backwards

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

Swapping

A

means to assign y’s value with x, and x’s value with y. If x is 33 and y is 55, then after swapping x is 55 and y is 33.

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