链表
Data Structures & Algorithms · 8 notes
- Print Linked List from Tail to Headhistorical
Given a linked list, return an ArrayList containing its values from tail to head.
- Reverse Linked Listhistorical
Given a linked list, reverse it and return the head of the reversed list.
- Merge Two Sorted Linked Listshistorical
Given two monotonically increasing linked lists, merge them into one linked list that remains monotonically non-decreasing.
- K-th Node from the End of a Linked Listhistorical
Given a linked list, return its k-th node from the end.
- Copy Complex Linked Listhistorical
Given a complex linked list (each node contains a node value and two pointers, one pointing to the next node and another special pointer pointing to any node), return the head of the copied complex linked list.
- Entry Node of a Loop in a Linked Listhistorical
Given a linked list, if it contains a cycle, find the entry node of the cycle; otherwise, return null.
- First Common Node of Two Linked Listshistorical
Given two linked lists, find their first common node. (Note: because the input data is provided as linked lists, invalid test data may be displayed in other ways; the input data is guaranteed to be valid.).
- Delete Duplicate Nodes in a Linked Listhistorical
In a sorted linked list, duplicate nodes may exist. Delete all duplicate nodes from the list without retaining any duplicate occurrence, and return the head pointer.