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

A skilled worker has no specific kind of trade. True False
In the carbon cycle what form are carbon atoms generally
What causes a hangnail to appear?
As trees were burned in the fire what is most likely released into the atmosphere
1) Rewrite the following sentences beginning with the words given. Ex. They waited for the captain's signal and then they jumped into the water. -> Not until
What is a middle colony in north america?
1. Find the vertices and locate the foci for the hyperbola whose equation is given. 49x2 - 16y2 = 784
Which sentence contains an adjective? A. Cockatiels enjoy summer sunshine. B. Cockatiels enjoy sunshine in the summer. C. In summer, cockatiels enjoy sunshine.
Which unit of measurement should Mara use to describe the weight of a bag of potatoes?
For your assignment, come up with a Strong Question about your future PLZ HELP