自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 收藏
  • 关注

原创 选择排序、插入排序、希尔排序

一、选择排序 SelectionSort思想找到数组中最小的那个元素,其次, 将它与数组的第一个元素交换位置(如果第一个元素就是最小元素那么它就和自己交换)。再次,在剩下的元素中找到最小的元素,将它与数组的第二个元素交换位置。如此往复,直到将整个数组排序。...

2021-01-20 18:32:29 105

原创 1480. Running Sum of 1d Array 一维数组的动态和

ProblemLeetcodeGiven an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]).Return the running sum of nums.ExampleInput: nums = [1,2,3,4]Output: [1,3,6,10]Explanation: Running sum is obtained as follows: [1, 1+2,

2021-01-19 21:40:50 81

原创 【Leetcode】 1232. Check If It Is a Straight Line 缀点成线

ProblemLeetcodeYou are given an array coordinates, coordinates[i] = [x, y], where [x, y] represents the coordinate of a point. Check if these points make a straight line in the XY plane.ExampleExample1Input: coordinates = [[1,2],[2,3],[3,4],[4,5],[5,

2021-01-17 14:41:41 86

原创 【Leetcode】 面试题 17.10. Find Majority Element LCCI 主要元素

ProblemLeetcodeA majority element is an element that makes up more than half of the items in an array. Given a positive integers array, find the majority element. If there is no majority element, return -1. Do this in O(N) time and O(1) space.ExampleEx

2021-01-16 16:54:59 122

原创 【Leetcode】 867. Transpose Matrix 转置矩阵

ProblemLeetcodeGiven a matrix A, return the transpose of A.The transpose of a matrix is the matrix flipped over it’s main diagonal, switching the row and column indices of the matrix.ExampleExample1:Input: [[1,2,3],[4,5,6],[7,8,9]]Output: [[1,4,7],

2021-01-16 15:26:01 85

原创 【Leetcode】 1672. Richest Customer Wealth 最富有客户的资产总量

ProblemLeetcodeYou are given an m x n integer grid accounts where accounts[i][j] is the amount of money the i​​​​​​​​​​​th​​​​ customer has in the j​​​​​​​​​​​th​​​​ bank. Return the wealth that the richest customer has.A customer’s wealth is the amount

2021-01-16 14:58:13 147

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除