LeetCode-94. Binary Tree Inorder Traversal
LeetCode-145. Binary Tree Postorder Traversal
LeetCode-144. Binary Tree Preorder Traversal
LeetCode-143. Reorder List
问题描述
You are given the head of a singly linked-list. The list can be represented as:
1 | L0 → L1 → … → Ln - 1 → Ln |
Reorder the list to be on the following form:
1 | L0 → Ln → L1 → Ln - 1 → L2 → Ln - 2 → … |
You may not modify the values in the list’s nodes. Only nodes themselves may be changed.
Example :

1 | Input: head = [1,2,3,4,5] |
Constraints:
- The number of nodes in the list is in the range
[1, 5 * 104]. 1 <= Node.val <= 1000
LeetCode-148. Sort List
LeetCode-82. Remove Duplicates From Sorted List II
问题描述
Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the linked list sorted as well.
Example :

1 | Input: head = [1,2,3,3,4,4,5] |
Constraints:
- The number of nodes in the list is in the range
[0, 300]. -100 <= Node.val <= 100- The list is guaranteed to be sorted in ascending order.
LeetCode-83. Remove Duplicates From Sorted List
LeetCode-328. Odd Even Linked List
问题描述
Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list.
The first node is considered odd, and the second node is even, and so on.
Note that the relative order inside both the even and odd groups should remain as it was in the input.
You must solve the problem in O(1) extra space complexity and O(n) time complexity.
Example :

1 | Input: head = [2,1,3,5,6,4,7] |
Constraints:
n ==number of nodes in the linked list0 <= n <= 104-106 <= Node.val <= 106
