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

Safety gear was provided to workers at the turn of the century. True False
Karina is showing her steps to solve the expression −26.7 ÷ 1 over 3. In which step did Karina make an error? Step 1: −26.7 ÷ 1 over 3 Step 2: −26.7 ⋅ −3 S
Question 8 please help I'm stuck
What role did muckrakers play in the progressive era??
How many fluid ounces are in 12 tee spoons?
The turning point helps the reader to _____. assess the effect significant moments had on the author's life relate the incidents to one's personal life evaluate
What kind of bias does the writer of the following paragraph have? The concert festival was a failure in all ways but one: ROXXOR gave a fantastic performance.
What condition occurs when the median nerve in the wrist is compressed? A. Broken Bone B. Carpal Tunnel Syndrome C. Tendonitis
How do you do this pleaseee whel Mee
If Siobhan hits a 0.25 kg volleyball with 0.5 N of force, what is the acceleration of the ball? ____ m/s2