摘要:
Sort a linked list in O(n log n) time using constant space complexity.这道题属于人生中第一次对链表进行操作,首先,不同于C++中的struct,java中可以用一个类来定义一个数据结构。这道题一看没有任何思路,就看别人的代码,发现... 阅读全文
摘要:
Implement int sqrt(int x).Compute and return the square root of x.这道题也属于二分查找的变形主流的方法是用牛顿插值,牛顿法的思想参考http://blog.csdn.net/StarCXDJ/article/details/18051... 阅读全文