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
2
Q
Index
A
In an array, each element’s location number is called the index
3
Q
Array Variable
A
an ordered list of items of a given data type and size
4
Q
Element
A
Each item in an array
5
Q
Scalar Variable
A
a single-item (non-array) variable
6
Q
[ ] are brackets
{ } are braces
( ) are parentheses
A
7
Q
for i = userInts.size - 1; i >= 0; i = i - 1
A
Go through array backwards
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.