Minsort+(ppalg+példa)

A minimumkereséses rendezés ppalg pszeudokódban. code ALGORITHM MinSort IS INPUT arr IS Array OUTPUT sorted IS Array VAR mini IS index of arr DO FOR i FROM arr.begin TO arr.end SET mini TO selectMin( arr[i..arr.end] ) SWAP arr[mini] WITH i END

FUNCTION selectMin is INPUT arr IS Array OUTPUT mini IS index of arr VAR min IS element of arr INIT SET mini TO arr.begin SET min TO arr[mini] DO FOR i FROM arr.begin + 1 TO arr.end IF arr[i] < min SET mini TO i           SET min TO arr[i] END code