Anonymous user
Sorting algorithms/Quicksort: Difference between revisions
→{{header|Forth}}
(add Forth) |
|||
Line 35:
: exch ( addr1 addr2 -- ) dup @ >r over @ swap ! r> swap ! ;
:
2dup mid @ >r ( r: pivot )
2dup begin
Line 44:
: qsort ( l r -- )
\ 2over 2over - + < if 2swap then
2dup < if recurse else 2drop then
|