
Patrick B. answered 05/09/20
Math and computer tutor/teacher
Base 2 log
It has been proven the Binary search algorithm requires at most log_2(n)+1 comparisons
Log_2(35)+1 =
log(35)/log(2) + 1 = <---- change of base
SEVEN 7
Gio P.
asked 05/08/20Hello, does anyone know how to answer this question?
How many max comparisons would be needed to check a specific number in an array of 35 sorted integers?
Thanks.
Patrick B. answered 05/09/20
Math and computer tutor/teacher
Base 2 log
It has been proven the Binary search algorithm requires at most log_2(n)+1 comparisons
Log_2(35)+1 =
log(35)/log(2) + 1 = <---- change of base
SEVEN 7
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.