Solved

The Code Segment Below Prints Some of the Elements in an Array

Question 62

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. 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++)


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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions