Thread: A sort question
View Single Post
Old Mar 25th, 2008, 4:42 PM   #4
Sane
Banned
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,101
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
Re: A sort question

Yes. It seems a bit strange to me too how each dictionary has only one item.

But it may not be the way you suggested Ooble, because a dictionary can not be sorted. The order of items in a dictionary can't be changed since the positions are arbitrarily assigned as a result of hash values. If you wanted to sort a dictionary, you would have to change its data type (which is in fact accomplished with the code you posted).
__________________
Looking for tough programming challenges? Try participating in Sane's Monthly Algorithms Challenges!
Composing Techno is a little side hobby of mine. Techno by DJ Sane. All free for download.
Sane is offline   Reply With Quote