会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
程序员小王
博客园
首页
新随笔
联系
订阅
管理
2015年3月19日
HappyLeetcode64:Sqrt(x)
摘要: Implement int sqrt(int x). 这道题本质上是求sqrt(x)下最大的整数。二分查找是比较容易想到的方法。另,在网上又学习了下别人的牛顿迭代法。 这是我原来的写法,写入是错误的,复杂度太高 class Solution { public: int sqrt(int x) { if (x > 1; int index = ...
阅读全文
posted @ 2015-03-19 11:36 程序员小王
阅读(131)
评论(0)
推荐(0)
编辑
公告