Arrays (Single & Double Dimensional) — Chapter Test

Answer all 5 questions, then submit. You need 60% to pass. Log in to save progress.

Question 1
The first element of an array a is at index…
A1
B0
C-1
Da.length
Question 2
Binary search requires the array to be…
Ain any order
Bsorted
Ctwo-dimensional
Dall positive
Question 3
Bubble sort works by…
Ahalving the array
Bcomparing and swapping adjacent pairs
Csearching each element
Dselecting the maximum only once
Question 4
In a 2-D array m, the number of rows is given by…
Am[0].length
Bm.length
Cm.rows
Dm.size()
Question 5
Diagonal elements of a square matrix are those where…
Ai + j == 0
Bi == j
Ci > j
Dj == 0