On Monday, June 16, 2014 8:37:52 AM UTC-7, TR NS wrote: > > > > On Sunday, June 15, 2014 5:11:31 PM UTC-4, Kevin Squire wrote: >> >> At one point while I was developing the OrderedDict class in >> DataStructures.jl, I made it possible to sort it (and sorting regular >> dictionaries returned an OrderedDict. It should be pretty easy to add that >> functionality back. You would need to load the DataStructures.jl package, >> of course. >> > > That makes a lot of sense to me. Is this something that works now, or are > you suggesting this as a possible future functionality? >
I worked up something this evening: https://github.com/JuliaLang/DataStructures.jl/pull/43 It needs some tests (and testing), but it seems to work. > > Also, I assume the time it takes to sort an OrderedDict would be on the > same order as sorting a Array of Tuple pairs. Is that right? > That's hard to judge without testing. The complexity of the sort will be the same order, but the actual wall time depends on a large number of factors--how many temporaries are created, the cost of the comparisons, how much data, whether or not the data is contiguous, etc. Cheers, Kevin
