加密算法LeetCode人工智能技术圈

LeetCode 分类刷题 —— Linked List

2019-06-06  本文已影响392人  一缕殇流化隐半边冰霜

前言

最近有朋友问我怎么没有更新文章了,因为最近有空的时候都在刷 LeetCode,零零星星刷了快 2 个月了,也累积了不少题目了,所以最近打算把做的几百道题归类,总结一下。所有题目的代码在 https://github.com/halfrost/LeetCode-Go,每道题都有测试用例和测试代码。

最近很有多评论问我简书文章里面的图片怎么没了?我并没有更改,只是最近日期比较敏感,简书把粉丝比较多的作者的图片都锁定了。等过了这段时间就好了。如果实在等不及,我的文章在 https://github.com/halfrost/Halfrost-Field 这里备份了一遍,图片都有,可以在这里看文章。

Linked List 的 Tips:

Title Solution Difficulty Time Space 收藏
2. Add Two Numbers Go Medium O(n) O(1)
19. Remove Nth Node From End of List Go Medium O(n) O(1)
21. Merge Two Sorted Lists Go Easy O(log n) O(1)
23. Merge k Sorted Lists Go Hard O(log n) O(1) ❤️
24. Swap Nodes in Pairs Go Medium O(n) O(1)
25. Reverse Nodes in k-Group Go Hard O(log n) O(1) ❤️
61. Rotate List Go Medium O(n) O(1)
82. Remove Duplicates from Sorted List II Go Medium O(n) O(1)
83. Remove Duplicates from Sorted List Go Easy O(n) O(1)
86. Partition List Go Medium O(n) O(1) ❤️
92. Reverse Linked List II Go Medium O(n) O(1) ❤️
109. Convert Sorted List to Binary Search Tree Go Medium O(log n) O(n)
141. Linked List Cycle Go Easy O(n) O(1) ❤️
142. Linked List Cycle II Go Medium O(n) O(1) ❤️
143. Reorder List Go Medium O(n) O(1) ❤️
147. Insertion Sort List Go Medium O(n) O(1)
148. Sort List Go Medium O(log n) O(n) ❤️
160. Intersection of Two Linked Lists Go Easy O(n) O(1) ❤️
203. Remove Linked List Elements Go Easy O(n) O(1)
206. Reverse Linked List Go Easy O(n) O(1)
234. Palindrome Linked List Go Easy O(n) O(1)
237. Delete Node in a Linked List Go Easy O(n) O(1)
328. Odd Even Linked List Go Medium O(n) O(1)
445. Add Two Numbers II Go Medium O(n) O(n)
725. Split Linked List in Parts Go Medium O(n) O(1)
817. Linked List Components Go Medium O(n) O(1)
707. Design Linked List Go Easy O(n) O(1)
876. Middle of the Linked List Go Easy O(n) O(1) ❤️
1019. Next Greater Node In Linked List Go Medium O(n) O(1)
上一篇 下一篇

猜你喜欢

热点阅读