2015年1月12日

Sqrt(x)

摘要: Implementint sqrt(int x).Compute and return the square root ofx.参考:http://standalone.iteye.com/blog/1847368参考的是一个用二分查找实现的,这道题还可以用什么牛顿法之类的如果middle * mi... 阅读全文

posted @ 2015-01-12 19:08 luckygxf 阅读(188) 评论(0) 推荐(0) 编辑

Simplify Path

摘要: Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"思路以/为分界符split,如/a/./b/..... 阅读全文

posted @ 2015-01-12 18:15 luckygxf 阅读(203) 评论(0) 推荐(0) 编辑

导航