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 is 3/8 divided by 7/2
In 1987, the IDEA law was amended to include: services and supports for children birth to 3 and their families. services and supports for children birth to 8 a
WILL GIVE THE BRAINLESTWhat is the value of g? combine like terms by moving them to one side then solve for g −5+7g=3g+9
el aprendizaje Learning a second language can actually increase one’s knowledge and ability in their first language. Please select the best answer from the
In order from lowest to highest frequency,list the different waves of the electromagnetic spectrum
Pleassssssseeeeeeeeeeeeeeeeeeeeee
Which distance measurement is the most precise? A- 6.2 centimetersB- 15 kilometersC- 1 meterD- 2.03 miles
What happened before/what caused the Boston Massacre?
In the story the fisherman and his wife is the fishermen’s conflict internal or external
Find the product of 5 times 8 less than 7