Yep, I suspect that this approach is probably best:

d = Dict{String,Int}()
# count the words
a = [ (c,w) for (w,c) in d ]
sort!(a)


For very large data, this may take up too much memory, however. I'm not
sure if that's your situation. If your data is large enough to take up more
than half of your available memory, then you need to get more clever.


On Mon, Jun 16, 2014 at 11:42 AM, TR NS <transf...@gmail.com> wrote:

>
>
> On Sunday, June 15, 2014 6:23:00 PM UTC-4, Stefan Karpinski wrote:
>>
>> Right, but for getting all the pairs in order, I don't think that
>> ordering them during insertion is helpful – it would be better to just sort
>> them all at once afterwards.
>>
>>
> I think so too. Which is why I don't think a priority queue is the right
> choice either. (Priority queues proactively keep order at insertion time,
> correct?)
>
>

Reply via email to