This Code Puzzler comes from the community contributor - Erik ColbanThanks, Eric for today's extra brain-teaser!Write a function that calculates the integer square root of any positive integer, but only uses add, subtract, left and right shifts, but no division or multiplication. The algorithm must run in O(log n) time. By integer square root I mean the largest integer whose square is less than...
↧