Multiple Choice
The code segment below prints some of the elements in an array with size n.Select an expression to complete the code segment so that the resulting algorithm has O(log n) running time.
A) (int j = 0; j < array.length; j = j + 2)
B) (int j = 0; j < array.length / 2; j++)
C) (int j = 1; j < array.length; j = j * 2)
D) (int j = 0; j < array.length; j++)
Correct Answer:

Verified
Correct Answer:
Verified
Q57: Consider the sort method shown below for
Q58: In big-Oh notation, when we consider the
Q59: The merge sort algorithm presented in section
Q60: A version of which sort algorithm is
Q61: Suppose a developer gets class XYZ files
Q63: Consider the swap method shown below from
Q64: Given the following code snippet for searching
Q65: In each iteration, selection sort places which
Q66: Selection sort has O(n<sup>2</sup>) complexity.If a computer
Q67: Which of the following arrays can be