From: miguel s. <mi...@ut...> - 2004-01-02 12:53:45
|
Attached an improved heapsort.tcl (40% faster here). It uses lists and [lset] instead of arrays, tries to reuse the result of variable assignments (readability <<), and is otherwise careful about avoiding some internal buglets (like && being slower than nested [if]s). Also replaced bitshift ops with multiplication - small diff, small runtime penalty, big improvement in readability. Miguel |