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

On a certain map, 2.5 inches represents 15 miles Bay City and green glitter 4 inches apart on the map what is the actual distance between Bay City and Greenwood
Clarire walked 2 and two fifths miles. Jason walked two thirds as far as claire did. How many mile did jason walk
What did the Supreme Court rule in the Munn v. Illinois case?
I NEED 10 GOOD QUESTIONS THAT I SHOULD ASK ISLANDERS WHOS ISLANDS ARE DISSAPEARING FROM CLIMATE CHANGING
Two extremely elastic folds of tissue known as vocal cords are found in the a. larynx. b. pharynx. c. trachea. d. bronchi.
What was imposed on Chinese immigrants to discourage them from mining gold?
Work Out: 2/5 of 16 miles :)
what conditions for organisms to compete in a struggle for existence
What are the different reasons why people supported abolition
New ideas came to the Greek mainland as a result of ?