Chapter 7 Flashcards

1
Q

Anonymous array

A

An array created without an explicit reference.

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

array

A

A data structure for storing a collection of data of the same type.

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

array initializer

A

A short hand notation to create and initialize an array.

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

binary search

A

An efficient method to search a key in an array. Binary search first compares the key with the element in the middle of the array and reduces the search range by half. For binary search to work, the array must be pre-sorted.

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

garbage collection

A

A JVM feature that automatically detects and reclaims the space occupied by unreferenced objects.

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

index

A

An integer value used to specify the position of an element in the array. The array index is an int value starting with 0 for the first element, 1 for the second, and so on.

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

indexed variable

A

A variable that is represented using an array reference along with an index to refer to an individual element in the array.

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

linear search

A

A method to search an element array. Linear search compares the key with the element in the array sequentially.

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

off-by-one error

A

Programmers often mistakenly reference the first element in the array with index 1, but it should be 0. This is called the off-by-one error.

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

postcondition

A

Used to describe the properties of a method. Postcondition are the things that are true after a method is called.

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

precondition

A

Used to describe the properties of a method. Precondition are the things that are true before a method is called.

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

selection sort

A

An approach to sort an array. It finds the largest number in the list and places it last. It then finds the largest number remaining and places it next to last, and so on until the list contains only a single number.

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