AlgorithmSort

LeetCode 分类刷题 —— Sort

Sort 的 Tips:

  • 深刻的理解多路快排。第 75 题。
  • 链表的排序,插入排序(第 147 题)和归并排序(第 148 题)
  • 桶排序和基数排序。第 164 题。
  • "摆动排序"。第 324 题。
  • 两两不相邻的排序。第 767 题,第 1054 题。
  • "饼子排序"。第 969 题。
Title Solution Difficulty Time Space 收藏
56. Merge Intervals Go Medium O(n log n) O(log n)
57. Insert Interval Go Hard O(n) O(1)
75. Sort Colors Go Medium O(n) O(1) ❤️
147. Insertion Sort List Go Medium O(n) O(1) ❤️
148. Sort List Go Medium O(n log n) O(log n) ❤️
164. Maximum Gap Go Hard O(n log n) O(log n) ❤️
179. Largest Number Go Medium O(n log n) O(log n) ❤️
220. Contains Duplicate III Go Medium O(n^2) O(1)
242. Valid Anagram Go Easy O(n) O(n)
274. H-Index Go Medium O(n) O(n)
324. Wiggle Sort II Go Medium O(n) O(n) ❤️
349. Intersection of Two Arrays Go Easy O(n) O(n)
350. Intersection of Two Arrays II Go Easy O(n) O(n)
524. Longest Word in Dictionary through Deleting Go Medium O(n) O(1)
767. Reorganize String Go Medium O(n log n) O(log n) ❤️
853. Car Fleet Go Medium O(n log n) O(log n)
710. Random Pick with Blacklist Go Hard O(n) O(n)
922. Sort Array By Parity II Go Easy O(n) O(1)
969. Pancake Sorting Go Medium O(n log n) O(log n) ❤️
973. K Closest Points to Origin Go Medium O(n log n) O(log n)
976. Largest Perimeter Triangle Go Easy O(n log n) O(log n)
1030. Matrix Cells in Distance Order Go Easy O(n^2) O(1)
1054. Distant Barcodes Go Medium O(n log n) O(log n)
支付宝扫码打赏 微信打赏

若你觉得我的文章对你有帮助,欢迎点击上方按钮对我打赏

扫描二维码,分享此文章

一缕殇流化隐半边冰霜's Picture
一缕殇流化隐半边冰霜

我是于德志 (@halfrost),一名来自中国的 iOS 开发者,已退役 acmer 。现居上海。从 2016 年开始写博客记录自己技术成长的一点一滴,到年底,成为简书推荐作者,2016 年度掘金最优秀的 10 佳原创作者。吾笃信:天道酬勤,勤能补拙。地道酬实,实能不弱。人道酬德,德能补寡。 目前就职于 饿了么 。

Shanghai「上海」 https://halfrost.com

Subscribe to Halfrost's Field | 冰霜之地

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!

Comments