Lesson 6 Flashcards
1
Q
What is an array?
A
An array is a variable having one name that holds a list of items while each item is accessible
2
Q
What is a vector?
A
A similar concept to an array used in other languages
3
Q
What is an element?
A
Each item in an array is called an element
4
Q
Array elements example
A
score[0], score[1], score[2], score[3], score[4]
5
Q
What is the index in an array?
A
The index is each element’s location number
6
Q
What is swapping?
A
switching two variables values with one another
ex.
if x < y
temp = x
x = y
y = temp
7
Q
A