Home /
Expert Answers /
Computer Science /
we-went-over-nbsp-an-algorithm-that-nbsp-approximates-the-sqr-nbsp-root-of-a-number-via-binary-searc-pa416

We went over an algorithm that approximates the sqr root of a number via binary search. A divide-and-conquer system can be used for computing logarithms.

Write an algorithm using no code that approximates the (bi- nary) logarithm y of a real number x ? 1, denoted by y = log(x). Also, suggest a sensible termination condition.

So, to find the largest integer i whose square is less than or equal to the given number. The idea is to use Binary Search to solve the problem. The values of i * i is monotonically increasing, so the problem can be solved using binary search. Algori