Data Structures & Algorithms
237 notes
Some notes are currently available only in Chinese. English translations are shown when available.
- Reorder Listhistorical
Reorder a singly linked list by alternating nodes from the beginning and end, changing links without modifying node values.
- Partition Listhistorical
Given the head head of a linked list and a value x, partition the list so that all nodes with values less than x come before nodes with values greater than or equal to x.
- Merge k Sorted Listshistorical
Merge k sorted linked lists into one sorted linked list. Analyze and describe the complexity.
- Merge Two Sorted Listshistorical
Merge two sorted linked lists into one new sorted linked list and return it. The new list is formed by splicing together all nodes from the two given lists.
- Odd Even Linked Listhistorical
Given the head head of a singly linked list, group all nodes at odd positions together followed by all nodes at even positions, and return the reordered list.
- Sort Listhistorical
Given the head head of a linked list, sort the list in ascending order and return the sorted list.
- Intersection of Two Linked Listshistorical
Write a program that finds the first node at which two singly linked lists intersect.