摘要:
原题链接在这里:https://leetcode.com/problems/reorder-list/ 题目: Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/ 题目: Given an array where elements are sorted in ascending order, con 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/ 题目: Given a singly linked list where elements are sorted in ascending 阅读全文
摘要:
Private means this could only be seen within this class. Protected means "package private", this could be seen by subclasses and package members. | Cl 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/sort-list/ 题目: Sort a linked list in O(n log n) time using constant space complexity. 题解: divide and conquer. 从中 阅读全文
摘要:
原题链接在这里:https://leetcode.com/problems/insertion-sort-list/ 题目: Sort a linked list using insertion sort. 题解: 与Sort List类似. 当出现cur.val > cur.next.val时就需 阅读全文