
算法
a soldiers
这个作者很懒,什么都没留下…
展开
-
Count Inversion逆序对数问题
逆序对数问题Count InversionProblem DescriptionRecall the problem of finding the number of inversions. As in the course, we are given a sequence of n numbers a1,··· ,an, which we assume are all distinct, an...原创 2019-10-15 20:03:11 · 745 阅读 · 0 评论 -
the kth number第几大数问题
第几大数问题the kth numberProblem descriptionFind the kth largest element in an unsorted array A . Note that it is the kth largest element inthe sorted order, not the kth distinct element. The range of l...原创 2019-10-15 19:14:50 · 330 阅读 · 0 评论 -
岛屿问题Number of Islands
**岛屿问题Number of Islands**Problem descriptionGiven a 2d mm * nn grid map of '1’s (land) and '0’s (water), count the number of islands. An island is surrounded by water and is formed by connecting a...原创 2019-10-15 14:26:37 · 250 阅读 · 0 评论 -
求众数Majority Element
求众数Majority ElementProblem descriptionGiven an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is ...原创 2019-10-15 14:34:18 · 147 阅读 · 0 评论