描述 Implement int sqrt(int x). Compute and return the square root of x. 分析二分查找。注意结果要向下取整时返回high。 代码Python12345678910111213141516171819202122class Solu ...
阅读全文 »

描述 Implement pow(x, n). 分析二分法,递归很简单,迭代有一定技巧。 代码递归1234567891011121314151617class Solution(object): def myPow(self, x, n): """ :type x ...
阅读全文 »