摘要:
Question Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? Solution 判断一个链表是否有环,可以采用slow f 阅读全文
摘要:
Question Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using ext 阅读全文
摘要:
LeetCode——Insertion Sort List Question Sort a linked list using insertion sort. Solution 我的解法,假设第一个节点都比其他节点小,这样感觉好移动指针一些,所以添加了一个额外的最小的节点。 Code 阅读全文
摘要:
LeetCode— Sort List Question Sort a linked list in O(n log n) time using constant space complexity. Solution 看到对链表的排序,时间复杂度O(n log n),首先想到的就是归并排序。 但是这 阅读全文