shekinahconnoll5055 shekinahconnoll5055
  • 23-03-2020
  • Computers and Technology
contestada

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.

for __________________________

System.out.println(array[j]);

Respuesta :

abdullahfarooqi
abdullahfarooqi abdullahfarooqi
  • 27-03-2020

Answer:

int j = 1; j < array.length; j =j *2

Explanation:

j=j*2 loops have O(logn) so the running time of algorithm is O(logn).

Answer Link

Otras preguntas

Which character from The Canterbury Tales "never stopped for rain or even for thunder"? a. the Knight b. the Nun c. The Parson d. the Yeoman
Find the value of 0.34x9. A... 3.21 B... 3.06 C... 306.0 D... 32.1
A skin rash is an example of a __________. Answer a. sign b. syndrome c. laboratory result d. symptom
what rhetorical techniques does Obama use
for any real number x,x2>x3
Generally, what will happen to most liquids if the temperature is increased? a. The triple point will drop. b. The solubility of the liquid will increase. c.
What are the three main reservoirs of the oxygen cycle? a. the atmosphere, the water cycle and rocks b. the biosphere, the water cycle and rocks c. the atmos
why was slave labor so important to the economy of southern colonies
As part of his efforts to Westernize Russia, Peter the Great made a. religious reforms. c. class-structure reforms. b. social reforms. d. judicial reforms.
Which one of the following choices best represents a characteristic of good walking technique? a. Pointing your toes toward the ground b. Taking short, slow s