I am coding a radix sort in python and I think that Python's dictionary may be a choice for bucket.
The only problem is that dictionary is a mapping without order. But I just found that if the keys are numeric, the keys themselves are ordered in the dictionary. part of my code is like this: radix={} for i in range(256): radix[i]=[] I checked and found that it is ordered like: {1:[], 2:[], 3[],...} So I can just print out the contents of the dictionary in the desired order without additional code. I also tried adding new numeric keys and found that the dictionary's keys are still ordered. However, I am not sure whether it is always like this. Can anybody confirm my finding? -- http://mail.python.org/mailman/listinfo/python-list