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

If jay ran 1 mile in 5 minutes on monday, 2 miles in 10 minutes on tuesday, and 3 miles in 15 minutes on wednesday, how many miles do you think he might run in
The current through a 12v lamp when it is connected to a 12v battery is 2.0 A. Calculate the resistance of the lamp at this current
Calculate the perimeter of an equilateral triangle which has sides of 14cm
Remove the parentheses from the following expression and combine like terms. 3(ax + b2 - c) + 2
217+37(3x−5)=−4 Drag and drop the statement that shows the solution to the equation into the box.
What is the algebraic expression for12 more than a number
Mental and emotional health can be improved through exercise.
A millimeter is _____ meter(s). A. 1,000 B. 100 C. 1/100th D. 1/1,000th
convert 29.7 cm to inches
Write the balanced molecular equation for the neutralization reaction between h2so4 and koh in aqueous solution. phases are optional.