o
i1
p0
in
V[i] = elem
pi
ii+ 1
n
permut indmax
n1 2 (n1) tripermutation
nc =Pn1
j=1 j=n(n1)
20
n1
i ind
in
i > 1
ind indmax(V, i)
ind 6=i
permut(V, i, ind
ii1
i p
p1
i2
in
V[i]V[p]
pi
ii+ 1
tmp :T
tmp V[i]
V[i]V[j]
V[j]tmp
i j
in
i > 1
j1
j < i
V[j+ 1] < V [j]
permut(V, j, j + 1)
jj+ 1
ii1
nc = (n1)+(n2)+..1 = n(n1)
2
n(n1)
2
ni n i
n1
log2(n)
i j
in
permut V RAI
j1
permut F AUX
j < i
V[j+ 1] < V [j]
permut V RAI
jj+ 1
ii1
trouve F AU X
inf 1
sup n
inf sup
m(inf +sup)/div2
V[m] = elem
trouve V RAI
V[m]< elem
inf m+ 1
sup m1
1 / 4 100%