Question: Design an O ( log 2 n ) algorithm that, given a positive integer n , determines whether n is of the form ab for
Design an Ologn algorithm that, given a positive integer n determines whether n is of
the form ab for some positive integers a and b For the purpose of this problem, you
mayassume exponentiation to be O time, ie computing pq for two integers p and q takes
constant time. Similarly, you can assume that comparison of two integers ie determining
whether p equals q p q or p q takes constant time.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
