基数排序算法,其原理是将整数按位数切割为不同的数组,然后按每个位数分别进行比较。
基数排序的方法既可以采用LSD(Least significant digital),从键值的最右边开始,也可以采用MSD(Most significant digital),从键值的最左边开始。
基数排序法的效率主要取决于排序不同位的数字时所采用的稳定的中间排序算法。
常用的稳定的排序算法包括:插入排序、合并排序、冒泡排序、折半插入排序、基数排序等。
基数排序算法相比于其他算法...
分类:
其他好文 时间:
2014-06-17 22:55:55
阅读次数:
414
Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two endpoints of line i is at (i, ai) and (i,
0). Fin...
分类:
其他好文 时间:
2014-06-17 22:17:43
阅读次数:
325
??
A class diagram
shows a set of classes, interfaces, and collaborations and their relationships. These diagrams are the most common diagram found in modeling object-oriented systems. Class diagram...
分类:
其他好文 时间:
2014-06-17 19:28:33
阅读次数:
261
The following tips are designed to help you use the microwave bags, and usually on the back of each bag. Most of sterilization bags in the market, the...
分类:
其他好文 时间:
2014-06-15 20:50:27
阅读次数:
271
Given a non-negative number represented as an array of digits, plus one to the number.
The digits are stored such that the most significant digit is at the head of the list.
思路:原有数组需要多出一位的唯一条件是数组所...
分类:
其他好文 时间:
2014-06-15 18:42:43
阅读次数:
162
异常
什么是异常
Python用异常对象来表示异常情况。遇到错误后,会引发异常。如果异常对象并未被处理或捕捉,程序就会用所谓的回溯(Traceback,一种错误信息)终止执行:
>>> 1/0
Traceback (most recent call last):
File "", line 1, in
1/0
ZeroDivisionError: integer...
分类:
编程语言 时间:
2014-06-15 13:33:25
阅读次数:
251
In most cases you will need root permission to be able to capture packets on an interface. Using tcpdump (with root) to capture the packets and saving...
分类:
其他好文 时间:
2014-06-15 06:51:22
阅读次数:
178
Follow up for ”Remove Duplicates”: What if duplicates are allowed at most twice?For example, Given sorted array A = [1,1,1,2,2,3],Your function should...
分类:
其他好文 时间:
2014-06-14 16:08:32
阅读次数:
200
Say you have an array for which theithelement
is the price of a given stock on dayi.If you were only permitted to complete at
most one transaction (ie...
分类:
其他好文 时间:
2014-06-13 15:55:47
阅读次数:
273
Update July 2011:This list has been reviewed and
made current with the most recent Eclipse 3.7 release.If you are a Java
developer and use the new @Su...
分类:
其他好文 时间:
2014-06-12 17:10:17
阅读次数:
278