Sort a linked list in O(n log n)
time using constant space complexity.
链表排序,O(nlgn)的复杂度,应该是归并或者快排,对链表来说归并应该用起来更顺手一些,尤其是对归并的步骤来说,链表这种数据结构真是再合适不过了。这里我用了递归调用来实现归并步骤,效率可能略微低那么一点点,但是代码简洁得不得了哇~~
归并排序是分治...
分类:
其他好文 时间:
2015-03-03 22:18:35
阅读次数:
160
Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?思路:...
分类:
其他好文 时间:
2015-03-03 21:57:07
阅读次数:
154
To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same s...
分类:
其他好文 时间:
2015-03-03 20:38:41
阅读次数:
148
To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same suffix. For example,...
分类:
其他好文 时间:
2015-03-03 18:41:39
阅读次数:
140
1、Application应用程序的参数args的设置,在Build->Set Main Projects Configuration2、程序运行快捷键F63、@Deprecated4、代码自动完成Ctrl+Space,利用这个可以添加类的构造函数5、变量统一修改Ctrl+R,取消用esc6、给方法...
分类:
Web程序 时间:
2015-03-03 18:08:04
阅读次数:
157
在ESX VM的一台服务器由于磁盘空间告警,打算决定给E盘扩展空间,增加20G的空间,在操作过程遭遇了Expanding Disk Volume gives error “There is not enough space available on the disk(s) to complete t...
分类:
其他好文 时间:
2015-03-03 13:21:42
阅读次数:
206
scp命令scp /home/space/music/1.mp3 root@www.cumt.edu.cn:/home/root/others/musicscp /home/space/music/1.mp3 root@www.cumt.edu.cn:/home/root/others/music/...
分类:
系统相关 时间:
2015-03-03 13:04:42
阅读次数:
140