lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

Some time ago (in April), there was a discussion about priority queues and heaps, in which Ge Weijers introduced me (and perhaps others, but maybe it wasn't news to them) to the skew heap (thanks!). Now, months later, I've had time to have a look at it properly and written a version that's a bit more of a lua object.

It's different from Ge's, because the clearest reference I found seemed to (as far as I can tell) have left and right the other way around, and mine's not actually faster than my binary heap (I think Ge's was). Anyway, I'm posting it here in case it's of any interest to anyone who followed the last thread, to get any comments (the last heap I posted got about 20% faster in minutes, thanks to, I think, Javier Guerra), and because someone might point out my obvious mistakes.

Cheers,
Geoff

Attachment: heap.zip
Description: Zip archive