… | |
… | |
754 | } |
754 | } |
755 | } |
755 | } |
756 | |
756 | |
757 | /*****************************************************************************/ |
757 | /*****************************************************************************/ |
758 | |
758 | |
|
|
759 | /* towards the root */ |
759 | void inline_speed |
760 | void inline_speed |
760 | upheap (WT *heap, int k) |
761 | upheap (WT *heap, int k) |
761 | { |
762 | { |
762 | WT w = heap [k]; |
763 | WT w = heap [k]; |
763 | |
764 | |
… | |
… | |
775 | |
776 | |
776 | heap [k] = w; |
777 | heap [k] = w; |
777 | ((W)heap [k])->active = k + 1; |
778 | ((W)heap [k])->active = k + 1; |
778 | } |
779 | } |
779 | |
780 | |
|
|
781 | /* away from the root */ |
780 | void inline_speed |
782 | void inline_speed |
781 | downheap (WT *heap, int N, int k) |
783 | downheap (WT *heap, int N, int k) |
782 | { |
784 | { |
783 | WT w = heap [k]; |
785 | WT w = heap [k]; |
784 | |
786 | |