CSCE 111 Ch. 7 Review

¡Supera tus tareas y exámenes ahora con Quizwiz!

To delete an item from an ArrayList object, you use this method. a. remove b. delete c. erase d. length

a. remove

Each element of an array is accessed by a number known as a(n) ______. a. subscript b. size declarator c. address d. specifier

a. subscript

The first subscript in an array is always ______. a. 1 b. 0 c. -1 d. 1 less than the number of elements

b. 0

This search algorithm steps through an array, comparing each item with the search value. a. binary search b. sequential search c. selection search d. iterative search

b. sequential search

In an array declaration, this indicates the number of elements that the array will have. a. subscript b. size declarator c. element sum d. reference variable

b. size declarator

T/F: An array's size declarator can be a negative integer expression.

F

T/F: The first size declarator in the declaration of a two-dimensional array represents the number of columns. The second size declarator represents the number of rows.

F

To insert an item at a specific location in an ArrayList object, you use this method. a. store b. insert c. add d. get

c. add

This array field hold the number of elements that the array has. a. size b. elements c. length d. width

c. length

The last subscript in an array is always ______. a. 1 b. 0 c. -1 d. 1 less than the number of elements

d. 1 less than the number of elements

This is the typical number of comparisons preformed by the sequential search on an array of N elements (assuming the search values are consistently found). a. 2N b. N² c. N d. N/2

d. N/2

T/F: The values in an initialization list are stored in the array in the order that they appear in the list

T

T/F: When an array is passed to a method, the method has access to the original array.

T

T/F: A two-dimensional array has multiple length fields

T

T/F: An ArrayList automatically expands in size to accommodate the items stores in it

T

This search algorithm repeatedly divides the portion of an array being searched in half. a. binary search b. sequential search c. selection search d. iterative search

a. binary search

When initializing a two-dimensional array, you enclose each row's initialization list in ______. a. braces b. parentheses c. brackets d. quotation marks

a. braces

To determine the number of items stored in an ArrayList object, you use this method. a. size b. capacity c. items d. length

a. size

Array bounds checking happens ______. a. when the program is compiled b. when the program is saved c. when the program runs d. when the program is loading into memory

c. when the program runs

T/F: Both of the following declarations are legal and equivalent: int [ ] numbers; int numbers [ ];

T

T/F: Java does not allow a statement to use a subscript that is outside the range of valid subscripts for an array.

T

T/F: The Java compiler does not display an error message when it processes a statement that uses an invalid subscript.

T

T/F: The subscript of the last element in a single-dimensional array is one less than the total number of elements in the array.

T


Conjuntos de estudio relacionados

Chronic Neurologic Problems: Degenerative Neurologic Disorders

View Set

Chapters 2-3: Zones of Tolerance and Ecological Succession

View Set

Scientific Revolution, Enlightenment and French Revolution Multiple Choice and Matching

View Set

Enzyme-Linked Immunosorbent Assay (ELISA)

View Set

Combo with "8 Pythagorean Theorem" and 27 others

View Set

Blood & Lymphatic Systems: Combining Forms

View Set

Chapter 14: Annuities and Individual Retirement Accounts

View Set