swerve2985 swerve2985
  • 25-07-2019
  • Computers and Technology
contestada

Which element would the search element be compared to first, if abinary search were used on the list above?

4
35
44
98

Respuesta :

KrystaCort KrystaCort
  • 31-07-2019

Answer:

35

Explanation:

Binary search is more efficient than linear search,time complexity of binary is 0(logn) where as linear's 0(n).In binary search we search from the middle of the array,whereas in linear we start with index 0 until the last.

4

35

44

98

List contains 4 elements, for finding the middle element we will divide by 2 .

4/2=2 so at the index 2 -35 is present ,we will start checking from 35.  

Answer Link

Otras preguntas

Yesterday, Abigail attended soccer practice for two hours, and then attended the school play rehearsal for m hours. Which expressions correctly show the combine
What was George Washington’s major concern about the rebellion in Massachusetts
which nitrogenous base is part of an RNA molecule but not a DNA molecule?
Which inverse operation is needed to isolate the variable in the equation r + 8.9 = 17.4?
What explains the popularity of the ghost dance movement in the 1880s?
Please help! Which of these is true ????
¿Qué quiere decir el “Día de Epifanía”? a. La llegada de los reyes c. La llegada de los españoles b. El niño Jesus se dió a conocer al mundo d. La celebración d
All human languages have several basic sounds in common called
You roll a fair 6-sided die.What is P(roll greater than 4)?
If each brick costs $0.68,and he can only buy whole bricks, how much will it cost him to get the material to put around the outside of his garden?