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 one or two paragraphs of a minimum of 150 words, compare and contrast how sound devices are used in the poems “The Bells” by Edgar Allan Poe and “She Walks i
The type of polygon impacts the formula used to find the area true or false
Read the excerpt from the article Amazing Plants: Some plants have unique ways of communicating with each other. When animals begin to graze on the African acac
The sum of 7 and c is greater than -20. (write the sentence into an inequality)
What was it like for families during the Great Depression?
what year im not sure
The Equal Rights Amendment (ERA) was formally proposed in 1972. It provided: “Equality of rights under the law shall not be denied or abridged by the United Sta
what percent of x is 2y? please explain
carbón,nitrogen,and water are all important to earth how?
Solve the system of equations.