HackerRank(Python)
文章平均质量分 80
scuhmz
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Insertion Sort - Part 2
Problem: In this challenge, don’t print every time you move an element. Instead, print the array every time an element is “inserted” into the array in (what is currently) its correct place. Since原创 2014-05-16 22:24:49 · 570 阅读 · 0 评论 -
[hackerrank]Counting Sort 3
In the previous challenge, it was easy to print all the integers in order, since you did not have to access the original list. Once you had obtained the frequencies of all the integers, you could simp原创 2014-05-16 21:58:53 · 765 阅读 · 0 评论 -
QuickSort1 - Partition
The previous challenges covered Insertion Sort, which is a simple and intuitive sorting algorithm. Insertion Sort has a running time of O(N2) which isn’t fast enough for most purposes. Instead, sort原创 2014-05-17 10:10:05 · 852 阅读 · 0 评论 -
QuickSort
In the previous challenge, you wrote a partition method to split an array into 2 sub-arrays, one containing smaller elements and one containing larger elements. This means you ‘sorted’ half the arra原创 2014-05-17 16:44:05 · 1125 阅读 · 0 评论 -
Insertion Sort Advanced Analysis(逆序对)
Insertion Sort is a simple sorting technique which was covered in previous challenges. Sometimes, arrays may be too large for us to wait around for insertion sort to finish. Is there some other way we原创 2014-05-19 22:10:01 · 651 阅读 · 0 评论 -
Pairs(hashset的查找应用)
Given N integers, count the total pairs of integers that have a difference of K. Input Format The 1st line contains N & K (integers). The 2nd line contains N numbers of the set. All the N number原创 2014-05-22 12:19:13 · 744 阅读 · 0 评论
分享