Should I use a dictionary?

phil hunt philh at comuno.freeserve.co.uk
Tue Jun 26 19:06:02 EDT 2001


On 25 Jun 2001 21:41:13 -0700, Aahz Maruch <aahz at panix.com> wrote:
>In article <sTTZ6.248652$p33.5007707 at news1.sttls1.wa.home.com>,
>Greg Jorgensen <gregj at pdxperts.com> wrote:
>>
>>When you want to sort the messages, use your own sort function to compare
>>the message date/time:
>
>That's a Bad Idea if there are a lot of messages; such comparison
>functions are expensive.

How else do you do sorting, without comparisons?

The comparisons could be made quicker by caching the date values
returned from the getdate() method. This would avoid having to
reparse them.

Anyway, with quicksort you only have to do n*log2(n) comparisons, IIRC.

-- 
==== Philip Hunt == philh at comuno.freeserve.co.uk ====
Want to stop global warming? Do you support the Kyoto
Treaty? Then boycott Esso (ExxonMobil in the USA).
See www.stopesso.com for details.






More information about the Python-list mailing list