Lists/dictionaries/Lin-Kernighan

François Pinard pinard at iro.umontreal.ca
Mon Sep 4 14:01:20 EDT 2000


[Gareth McCaughan]

> A concrete suggestion, if you really do need good asymptotics: use a
> heap. One way to think about (and implement) a heap is as an array of
> elements for which it's always true that a[i] <= a[(i-1)/2] where "/"
> means integer division, as in Python. Then you can define the following
> stuff (WARNING: untested code ahead...)

A while ago, I published similar code on the Python list, tested.  I should
have put it somewhere on the Web, but not yet.  Anybody curious, just ask.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Python-list mailing list