快速排序
文章平均质量分 88
memcpy0
希望探索文理结合的自由之路。
展开
-
LeetCode 1337. The K Weakest Rows in a Matrix【数组,二分,堆,快速选择,排序】1224
本文属于「征服LeetCode」系列文章之一,这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁,本系列将至少持续到刷完所有无锁题之日为止;由于LeetCode还在不断地创建新题,本系列的终止日期可能是永远。在这一系列刷题文章中,我不仅会讲解多种解题思路及其优化,还会用多种编程语言实现题解,涉及到通用解法时更将归纳总结出相应的算法模板。为了方便在PC上运行调试、分享代码文件,我还建立了相关的。原创 2023-09-18 23:28:58 · 189 阅读 · 0 评论 -
LeetCode 2475. Number of Unequal Triplets in Array【数组,排序,哈希表】简单
本文属于「征服LeetCode」系列文章之一,这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁,本系列将至少持续到刷完所有无锁题之日为止;由于LeetCode还在不断地创建新题,本系列的终止日期可能是永远。在这一系列刷题文章中,我不仅会讲解多种解题思路及其优化,还会用多种编程语言实现题解,涉及到通用解法时更将归纳总结出相应的算法模板。。原创 2023-06-16 15:05:00 · 935 阅读 · 0 评论 -
LeetCode 1029. Two City Scheduling 【贪心,堆,排序,快速选择】中等
本文属于「征服LeetCode」系列文章之一,这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁,本系列将至少持续到刷完所有无锁题之日为止;由于LeetCode还在不断地创建新题,本系列的终止日期可能是永远。在这一系列刷题文章中,我不仅会讲解多种解题思路及其优化,还会用多种编程语言实现题解,涉及到通用解法时更将归纳总结出相应的算法模板。。原创 2023-06-09 15:28:53 · 767 阅读 · 0 评论 -
LeetCode 1090. Largest Values From Labels【贪心,排序,哈希表】中等
本文属于「征服LeetCode」系列文章之一,这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁,本系列将至少持续到刷完所有无锁题之日为止;由于LeetCode还在不断地创建新题,本系列的终止日期可能是永远。在这一系列刷题文章中,我不仅会讲解多种解题思路及其优化,还会用多种编程语言实现题解,涉及到通用解法时更将归纳总结出相应的算法模板。。原创 2023-05-23 13:21:37 · 449 阅读 · 0 评论 -
LeetCode 面试题 17.14. Smallest K LCCI【堆/排序/分治】中等
Design an algorithm to find the smallest K numbers in an array.Example: Input: arr = [1,3,5,7,2,4,6,8], k = 4Output: [1,2,3,4]Note: 0 <= len(arr) <= 100000 0 <= k <= min(100000, len(arr))题意:设计一个算法,找出数组中最小的 k 个数。以任意顺序返回这 k 个数均可。..原创 2021-09-06 17:22:00 · 140 阅读 · 0 评论 -
LeetCode C++ 973. K Closest Points to Origin【Sort/Divide and Conquer/Heap】中等
We have a list of points on the plane. Find the K closest points to the origin (0, 0).(Here, the distance between two points on a plane is the Euclidean distance.)You may return the answer in any order. The answer is guaranteed to be unique (except for原创 2020-11-09 16:53:26 · 171 阅读 · 0 评论