Quicksort: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
<div style="font-size: 1.2em; margin:.5em 0 .5em 0;text-align:center">[https://openlearnware.tu-darmstadt.de/#!/resource/quick-sort-1945 Openlearnware]</div> | <div style="font-size: 1.2em; margin:.5em 0 .5em 0;text-align:center">[https://openlearnware.tu-darmstadt.de/#!/resource/quick-sort-1945 Openlearnware]</div> | ||
</div> | </div> | ||
== General Information == | |||
'''Algorithmic problem:''' [[Sorting based on pairwise comparison]] | |||
'''Type of algorithm:''' recursion | |||
== Abstract View == | |||
'''Invariant:''' After a recursive call, the input sequence of this recursive call is sorted. | |||
'''Variant:''' In each recursive call, the sequence of the callee is strictly shorter than that of the caller. | |||
'''Break condition:''' The sequence is empty or a singleton. | |||
== Induction Basis == | |||
'''Abstract view:''' Nothing to do on an empty sequence or a singleton. | |||
'''Implementation:''' Ditto. | |||
'''Proof:''' Empty sequences and singletons are trivially sorted. | |||
== Induction Step == | |||
== Complexity == | |||
== Further Information == |
Revision as of 13:26, 2 October 2014
General Information
Algorithmic problem: Sorting based on pairwise comparison
Type of algorithm: recursion
Abstract View
Invariant: After a recursive call, the input sequence of this recursive call is sorted.
Variant: In each recursive call, the sequence of the callee is strictly shorter than that of the caller.
Break condition: The sequence is empty or a singleton.
Induction Basis
Abstract view: Nothing to do on an empty sequence or a singleton.
Implementation: Ditto.
Proof: Empty sequences and singletons are trivially sorted.