-
Notifications
You must be signed in to change notification settings - Fork 0
/
ALG.php
40 lines (39 loc) · 1.24 KB
/
ALG.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<html>
<head>
<script type="text/javascript">
/*¿ìËÙÅÅÐò*/
function quickSort(arr,l,r)
{
if(l<r)
{
var i=1,j=r,x=arr[i];
while(i<j)
{
while(i<j&&arr[j]>x)
{
j--;
}
if(i<j)
{
arr[i++]=arr[j];
}
while(i<j&&arr[i]<x)
{
i++;
}
if(i<j)
{
arr[j--]=arr[i];
}
}
arr[i]=x;
quickSort(arr,l,i-1);
quickSort(arr,i+1,r);
}
}
</script>
</head>
<body >
</body>
</html>
<?php ?>