Choose the most correct answer to all the following questions.
Read them carefully to ensure you understand the question.
In order to perform a binary search, the source data array must be sorted.
A binary search algorithm discards one quarter of the source data after each comparison.
A bubble sort algorithm makes a number of passes through the data, comparing adjacent pairs. After the first pass, the last data item is in sorted order.
The bubble sort is the most efficient sorting algorithm available.
The String method compareTo() returns a(n)
The String method equals() returns
You are bubble sorting an array with 10 elements. The number of passes through the data is
The first dimension of a two dimensional array represents the _ _ _ _ _ _ _ _ _ _ _ _.
The second dimension of a two dimensional array represents the _ _ _ _ _ _ _ _ _ _ _ _ _ _ _.
int[] table = new int[5][5];
The statement table.length returns
int[] table = new int[5][5];
The statement table[0].length returns _.
List the two main reasons for sorting data.
Consider the following:
System.out.println("a".compareTo("b"));
What will be printed to the screen when the above code executes?
Consider the following:
System.out.println(""a".compareTo("a"));
What will be printed to the screen when the above code executes?
What method is used to wriite an object to a file?
What method is used to read an object from a file?
What is the name of the process that writes an object to a file?
What two java classes must be used to write an object to a file?