代码改变世界

[LeetCode] 876. Middle of the Linked List_Easy tag: Linked List

2019-05-02 10:12 by Johnson_强生仔仔, 299 阅读, 0 推荐, 收藏, 编辑
摘要:Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, return the second middl 阅读全文

[LeetCode] 86. Partition List_Medium tag: Linked List

2019-05-02 09:57 by Johnson_强生仔仔, 254 阅读, 0 推荐, 收藏, 编辑
摘要: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 阅读全文

[LeetCode] 92. Reverse Linked List II_Medium tag: Linked List

2019-05-01 11:09 by Johnson_强生仔仔, 222 阅读, 0 推荐, 收藏, 编辑
摘要:Reverse a linked list from position m to n. Do it in one-pass. Note: 1 ≤ m ≤ n ≤ length of list. Example: 这个题目是在[LeetCode] 206. Reverse Linked List_Ea 阅读全文

[LeetCode] 82. Remove Duplicates from Sorted List II_Medium tag: Linked List

2019-04-30 11:12 by Johnson_强生仔仔, 192 阅读, 0 推荐, 收藏, 编辑
摘要:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinctnumbers from the original list. Example 1: Input: 1->2- 阅读全文

[LeetCode] 83. Remove Duplicates from Sorted List_Easy tag: Linked List

2019-04-30 10:35 by Johnson_强生仔仔, 211 阅读, 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- 阅读全文

[LeetCode] 206. Reverse Linked List_Easy tag: Linked List

2019-04-30 03:14 by Johnson_强生仔仔, 209 阅读, 0 推荐, 收藏, 编辑
摘要:Reverse a singly linked list. Example: Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? 很基本的一道换顺序 阅读全文

[LeetCode] 系统刷题6_Linked List

2019-04-30 01:07 by Johnson_强生仔仔, 290 阅读, 0 推荐, 收藏, 编辑
摘要:1. Dummy Node [LeetCode] 83. Remove Duplicates from Sorted List_Easy tag: Linked List [LeetCode] 82. Remove Duplicates from Sorted List II_Medium tag: 阅读全文

[LeetCode] 系统刷题5_Dynamic Programming

2019-04-30 00:06 by Johnson_强生仔仔, 323 阅读, 0 推荐, 收藏, 编辑
摘要:Dynamic Programming 实际上是[LeetCode] 系统刷题4_Binary Tree & Divide and Conquer的基础上,加上记忆化的过程。就是说,如果这个题目实际上是类似于Divide and conquer或者说是DFS,但是在计算过程中有很多重复计算同样的过程 阅读全文

[LeetCode] 97. Interleaving String_ Hard tag: Dynamic Programming

2019-04-29 11:54 by Johnson_强生仔仔, 229 阅读, 0 推荐, 收藏, 编辑
摘要:Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. Example 1: Input: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbcbcac" Output: 阅读全文

[LeetCode] 115. Distinct Subsequences_ Hard tag: Dynamic Programming

2019-04-28 11:21 by Johnson_强生仔仔, 245 阅读, 0 推荐, 收藏, 编辑
摘要:Given a string S and a string T, count the number of distinct subsequences of S which equals T. A subsequence of a string is a new string which is for 阅读全文
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 39 下一页