#include
"
iostream.h
"
void
quick_sort(
int
list[],
int
left,
int
right)
{
int
i
=
left,j
=
right,temp
=
list[i];
while
(i
<
j)
{
while
((i
<
j)
&&
(list[j]
>
temp)) j
--
;
list[i]
=
list[j];
while
((i
<
j)
&&
(list[i]
<=
temp)) i
++
;
list[j]
=
list[i];
}
list[i]
=
temp;
if
(left
<
i
-
1
)quick_sort(list,left,i
-
1
);
if
(i
+
1
<
right)quick_sort(list,i
+
1
,right);
}