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

what group do they go in
Which table shows a function that is decreasing over the interval (−2, 0)? A 2-column table with 4 rows. The first column is labeled x with entries negative 2,
Manipulating Positive Rational Numbers LC) PLSSSS 100 POINTS WILL MARK BRAINLYEST MY MOM WILL KILL ME IF I DONT ANSWER THIS QUESTION What is 71% written as a fr
is pain a opposite word for relief?​
what is the difference between encoding and decoding?
what group do they go in
(07.02 LC) Which was true about life as an enslaved person? A: Enslaved persons often suffered from undernourishment. B: Enslaved persons were paid for their wo
Question 7 (1 point) The polygons in each pair are similar. Find the scale factor of the smaller figure to the larger figure.
Can anyone write me a diary entry in 200 words on 75years of independence with at least 10 literary devices……pls i need it very muchhh……please no spam
2 Explain Does figure B appear to be a reflection of figure A for each pair of figures? Explain why or why not. A LA B 5131735 A B