.


: 3, 7, 9, 1, 4.
1: 1, 7, 9, 3, 4.
2: 1, 3, 9, 7, 4.
3: 1, 3, 4, 7, 9. .
.

.
:
x1, 2, ..., N - .
.: x1', x2', ..., N' - .
: 1' £
2' £
... £ N'.
: N > 0.
:


k=1 N-1
:= xk
imn := k
i=k+1 N
xi <
:= xi
imn : = i


xmn = Min (k, ..., N)
xk' =
ximn ' = xk
렠 k¢ = Min (k, ..., N)
x1 < 2
< ... < k¢
, ­ - , .
( ) ­ x[k:N]. k- k-e .
1.



:= xk
imn := k
i
= k + 1 N

xi <

:= xi
imn := i

렠 { xmn = Min (k, ..., 1) }


xmn = Min (k, ..., N).
. .
xmnk =
xk.
i = k + 1 :
xk+1 xk+1 < xmnk,
xmnk+l =