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 were to effects of the Holocaust
Which word would describe something to show that it is happening to agreat extent or high degree?accommodationO considerablyO virtuallyWhich word would describe
what is the retail price of the lamp
volume of triangles prism 8.9 cm 8cm 14cm
Romeo and Juliet, please answer
Tina has 13 cups of water to divide evenly among 7 plants. which of the following best approximates the number of cups of water that each plant will get ? 1/2,
Choose one of the three acts/programs in this weekly readings (The Conservation Reserve Program, Endangered Species Act our Clean Water Act). Do a quick Google
bacteria is a first line of defense for our immune system. true or false a. true b. false
Medical implants and high-quality jewelry items for body piercing are frequently known by a trade name, G23Ti, which means "surgical-grade" titanium. It is made
Which body system do you find most interesting, and why? Will mark BRAINLIEST!!