Explanation: we can optimize the code for finding power of a number by calculating x raised to power y/2 only once and using it depending on whether y is even or odd.
Q. What is the least time in which we can raise a number x to power y?
β
Correct Answer: (D)
o(log y)
Explanation by: Mr. Dubey
we can optimize the code for finding power of a number by calculating x raised to power y/2 only once and using it depending on whether y is even or odd.
Discussion
Question Analytics
511
Total Visits
3 y ago
Published
Mr. Dubey
Publisher
95%
Success Rate