Sort And Searching Question:
Download Questions PDF

Explain Binary representation?

Sort And Searching Interview Question
Sort And Searching Interview Question

Answer:

Binary search is nearly the same computation as converting a number to binary! Each guess determines one bit of the answer. In our example, the information that the number is between 0 and 127 says that the number of bits in its binary representation is 7, the answer to the first question tells us the value of the leading bit, the answer to the second question tells us the value of the next bit, and so forth. For example, if the number is 77, the sequence of answers no yes yes no no yes no immediately yields 1001101, the binary representation of 77.

Download Sort And Searching Interview Questions And Answers PDF

Previous QuestionNext Question
What is Linear-logarithm chasm?How to Inverting a function in Sort And Searching?