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

In an atom, the number of neutrons determines most specifically the ________.
what is the volume of a box that will hold exactly 567 of these cubes with 1/3 inch sides?
What can lead to reproductive isolation after just one generation? a. polyploidy c. changed allele frequencies b. increased mutation rate d. independent assor
45 Points! Please help with this it's either B or C
What is the best way to shape your body, gym ou sports?
A group of students are collaborating on an online research project. Which is an example of appropriate online behavior?
Why did american consumers cut back on borrowing and spending after 2008?
Will give brainliest+ 50 pts!!! In modern tragedies, the role of ____ is often eliminated or minimized, sometimes under the guise of “fate.” a.the gods b.deus e
EASY POINTS Nelson, a network designer, conducts a needs assessment to ... A)analyze which workers are most productive B)compare worker needs C)determine what
What was the main reason that President Thomas Jefferson sent representatives to France?