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 his science class, Mr. Brown heats a small amount of iodine in a test tube. The iodine changes into a pink gas without changing into liquid. What is this pro
What is the relationship among the numbers and symbols in the expression 24 ÷ (3 + 5)? Choose all answers that are correct. A. Twenty-four is split into 3 plus
The perimeter of a park is 20.1208 km. Side A is 4.0491 km shorter than side B. How long are sides A and B?
Escribe la forma correcta de las palabras de la lista para completar el párrafo alguno/a ni siquiera jamás también siempre ningun
Resources that were created over millions of years from the remains of prehistoric plants and animals are called
What is the major ethnic group in Western Russia? Anglo Kurd Germanic Slavic
Explain the process that causes dew to form on blades of grass.
Select all that apply. India is the home to what two religions? Islam Hinduism Taoism Shintoism Buddhism
what is the actual distance between Gendet and Montrose? Help on number 9 plz
3x-9x+6=20-3x+4x Please answer.