随笔分类 -  linked list(others)

142. Linked List Cycle II
摘要:数学题的感觉, 想不出来 https://www.qiujiawei.com/leetcode-problem-142/ 阅读全文

posted @ 2018-11-09 07:10 猪猪🐷

725. Split Linked List in Parts
摘要:https://leetcode.com/problems/split-linked-list-in-parts/solution/ 阅读全文

posted @ 2018-11-08 16:22 猪猪🐷

143. 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 may not modify the values in the list's nodes, only nodes itself may be changed. Example 1: Given 1->2->3->4,... 阅读全文

posted @ 2018-11-08 02:28 猪猪🐷

148. Sort List
摘要:Sort a linked list in O(n log n) time using constant space complexity. Example 1: Input: 4->2->1->3 Output: 1->2->3->4 Example 2: Input: -1->5->3->4->0 Output: -1->0->3->4->5 https://www.youtub... 阅读全文

posted @ 2018-11-08 02:28 猪猪🐷

708. Insert into a Cyclic Sorted List
摘要:Given a node from a cyclic linked list which is sorted in ascending order, write a function to insert a value into the list such that it remains a cyc 阅读全文

posted @ 2018-08-28 20:44 猪猪🐷

234. Palindrome Linked List
摘要:234. Palindrome Linked List Could you do it in O(n) time and O(1) space? O(1) space means no extra space, no extra data structure https://leetcode.com 阅读全文

posted @ 2018-08-09 17:23 猪猪🐷

138. Copy List with Random Pointer
摘要:A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文

posted @ 2018-07-18 09:37 猪猪🐷

328. Odd Even Linked List
摘要: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 @ 2018-07-18 09:31 猪猪🐷

141. Linked List Cycle
摘要:Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? Given a linked list, determine if it has 阅读全文

posted @ 2018-07-18 09:28 猪猪🐷

369. Plus One Linked List
摘要:Given a non-negative integer represented as non-empty a singly linked list of digits, plus one to the integer. You may assume the integer do not conta 阅读全文

posted @ 2018-07-18 09:27 猪猪🐷

445. Add Two Numbers II
摘要:You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contai 阅读全文

posted @ 2018-07-18 09:26 猪猪🐷

2. Add Two Numbers
摘要:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai 阅读全文

posted @ 2018-07-18 09:25 猪猪🐷

160. Intersection of Two Linked Lists
摘要:Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文

posted @ 2018-07-18 09:24 猪猪🐷

21. Merge Two Sorted Lists
摘要: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 @ 2018-07-18 09:21 猪猪🐷

86. Partition List
摘要:Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the 阅读全文

posted @ 2018-07-18 09:20 猪猪🐷

61. Rotate List
摘要: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 @ 2018-07-18 09:19 猪猪🐷

导航