Answer the question
In order to leave comments, you need to log in
What is the maximum number of operations in a binary search?
The number of operations can be calculated, for example, using the log n formula, but when I check this on the sheet, it turns out to be 1 more. If we take 8, then the maximum number of operations according to the formula will be 3, let's say I guessed 8, it turns out:
-4?
-More.
-6?
-More.
-7?
-More.
-eight?
Yes.
And the number 8 was guessed only after 4 attempts. Why doesn't the formula work?
Answer the question
In order to leave comments, you need to log in
They made a mistake with the edges: 3 bits (3 questions) are numbers from 0 to 7.
Each question specifies a bit, from the highest to the lowest:
0 000
1 001
2 010
3 011
4 100 - четыре? - больше (старший бит 1xx )
5 101
6 110 - шесть? - больше ( 11x )
7 111 - семь – ага
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question