Smoothsort: Difference between revisions

Content deleted Content added
Operations: Reformulate this section
Line 59:
====Optimization====
In this description, one knows that at the position where trinkle starts the heap property is already valid. So I can simplify by, instead of doing the tests that trinkle needs to do, just compare and possibly swap the element with the root before it (if any), and afterwards apply trinkle at its new position if a swap was actually done. Since a swap may invalidate the heap property at the new position where the smaller root moved to, the simplification only applies to the first step.
 
LocalWords: trinkle
 
==Analysis==