上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 33 下一页
摘要: Given a linked list, rotate the list to the right by k places, where k is non-negative. Example 1: Input: 1->2->3->4->5->NULL, k = 2 Output: 4->5->1-> 阅读全文
posted @ 2020-01-01 11:24 xuan_abc 阅读(141) 评论(0) 推荐(0)
摘要: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 阅读全文
posted @ 2020-01-01 10:14 xuan_abc 阅读(110) 评论(0) 推荐(0)
摘要: Given a singly linked list, determine if it is a palindrome. Example 1: Input: 1->2 Output: false Example 2: Input: 1->2->2->1 Output: true /** * Defi 阅读全文
posted @ 2019-12-31 11:48 xuan_abc 阅读(125) 评论(0) 推荐(0)
摘要: Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numb 阅读全文
posted @ 2019-12-31 11:07 xuan_abc 阅读(117) 评论(0) 推荐(0)
摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: 阅读全文
posted @ 2019-12-31 06:19 xuan_abc 阅读(114) 评论(0) 推荐(0)
摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Example 1: Input: 1->2 阅读全文
posted @ 2019-12-31 05:42 xuan_abc 阅读(95) 评论(0) 推荐(0)
摘要: Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Input: 1->1->2 Output: 1->2 Example 2: Input: 1- 阅读全文
posted @ 2019-12-30 11:58 xuan_abc 阅读(84) 评论(0) 推荐(0)
摘要: Reverse a linked list from position m to n. Do it in one-pass. Note: 1 ≤ m ≤ n ≤ length of list. Example: Input: 1->2->3->4->5->NULL, m = 2, n = 4 Out 阅读全文
posted @ 2019-12-30 11:08 xuan_abc 阅读(161) 评论(0) 推荐(0)
摘要: Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the 阅读全文
posted @ 2019-12-30 01:03 xuan_abc 阅读(128) 评论(0) 推荐(0)
摘要: Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list's nodes, only nodes itself may be ch 阅读全文
posted @ 2019-12-29 12:06 xuan_abc 阅读(90) 评论(0) 推荐(0)
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 33 下一页