![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 90
wlhr62
这个作者很懒,什么都没留下…
展开
-
超详细讲解-十大经典排序算法-总结
文章目录排序算法介绍今日份鸡汤:你战胜了苦难,它就是你的财富; 苦难战胜了你,它就是你的屈辱。排序算法介绍排序算法是数据结构中最基本的算法,也是最经典的算法之一。排序算法有多种分类方法,如:内排和外排、比较排序和非比较排序、稳定排序和非稳定排序等。排序算法大体可分为两种:一种是比较排序,时间复杂度O(nlogn) ~ O(n^2),主要有:冒泡排序,选择排序,插入排序,归并排序,堆排序,快速排序等。另一种是非比较排序,时间复杂度可以达到O(n),主要有:计数排序,基数排序,桶排序原创 2021-11-01 17:54:06 · 375 阅读 · 0 评论 -
超详细讲解:leetcode-0009-PalindromeNumber(回文数)
文章目录1. 题目地址2. 题目描述3. 解题思路4. 解题关键5. 示例代码6. 相关题目11. 题目地址英文版题目地址中文版题目地址2. 题目描述英文描述Given an integer x, return true if x is palindrome integer.An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome whil原创 2021-10-28 22:42:38 · 3042 阅读 · 0 评论 -
超详细讲解:leetcode-0026-RemoveDuplicatesFromSortedArray(删除排序数组中的重复项)
文章目录1. 题目地址2. 题目描述3. 解题思路4. 解题关键5. 示例代码6. 相关题目1. 题目地址英文版题目地址中文版题目地址2. 题目描述英文描述Given a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length.Do not allocate extra space for another原创 2021-01-10 17:08:36 · 104 阅读 · 0 评论 -
超详细讲解:leetcode-0167-TwoSumII-InputArrayIsSorted(两数之和II-输入有序数组)
文章目录1. 题目地址2. 题目描述3. 解题思路4. 解题关键5. 示例代码6. 相关题目可以先看下超详细讲解:leetcode-leetcode-0001-TwoSum(两数之和),这个是其第二个版本,即增加了数组是有序数组这一条件。难度:简单。1. 题目地址英文版题目地址中文版题目地址2. 题目描述英文描述Given an array of integers that is already sorted in ascending order, find two numbers s原创 2021-01-04 22:29:15 · 99 阅读 · 0 评论 -
超详细讲解:leetcode-0125-ValidPalindrome(验证回文串)
文章目录1. 题目地址2. 题目描述3. 解题思路4. 解题关键5. 示例代码6. 相关题目1. 题目地址英文版题目地址中文版题目地址2. 题目描述英文描述Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.Note: For the purpose of this problem, we define empty st原创 2021-01-04 21:42:40 · 218 阅读 · 3 评论 -
超详细讲解:leetcode-0002-AddTwoNumbers(两数相加)
题目地址英文版地址中文版地址题目描述英文描述You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. A...原创 2020-05-31 23:33:03 · 222 阅读 · 0 评论 -
超详细讲解:leetcode-0001-TwoSum(两数之和)
题目地址英文版地址中文版地址题目描述英文描述Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same element twice.Example:G原创 2020-06-03 14:05:33 · 201 阅读 · 0 评论 -
超详细讲解:leetcode-0136-SingleNumber(只出现1次的数字)
文章目录1. 题目地址2. 题目描述3. 解题思路4. 解题关键5. 示例代码6. 相关题目1. 题目地址英文版题目地址中文版题目地址2. 题目描述英文描述Given a non-empty array of integers nums, every element appears twice except for one. Find that single one.Follow up: Could you implement a solution with a linear run原创 2020-11-17 22:01:27 · 361 阅读 · 1 评论 -
超详细讲解:leetcode-0316_1-相关题目1(2个只出现1次的数字)
文章目录1. 题目描述2. 解题思路4. 解题关键5. 示例代码6. 相关题目可以先看下leetcode-0316-SingleNumber(只出现1次的数字),这个是其衍生的相关题目。1. 题目描述中文描述有一个 n 个元素的数组,除了两个数只出现 1 次外,其余元素都出现 2 次,让你找出这两个只出现一次的数分别是几。要求时间复杂度为 O(n) 而且,再开辟的内存空间固定(与 n 无关)。2. 解题思路只有两个数字分别只出现了1次,其余元素都出现了两次。回顾一下leetcod原创 2020-12-11 14:39:28 · 200 阅读 · 1 评论