
经典排序算法
用经典排序算法的思想解题。
愤怒的可乐
主要研究NLP、深度学习、大模型。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode刷题——88. 合并两个有序数组
题目思路显然考察的是归并排序算法的核心:归并操作的熟练度。代码class Solution(object): def merge(self, nums1, m, nums2, n): """ :type nums1: List[int] :type m: int :type nums2: List[int] :type n: int :rtype: None Do not return anyt原创 2021-02-18 11:34:27 · 297 阅读 · 0 评论 -
LeetCode刷题——75. 颜色分类
题目解法一不就是排序吗,这是我见过最简单的题目哈哈。class Solution(object): def sortColors(self, nums): """ :type nums: List[int] :rtype: None Do not return anything, modify nums in-place instead. """ return nums.sort()结果还不错,平常碰到这种原创 2021-02-18 11:05:26 · 271 阅读 · 0 评论