[quote]
引用第1楼TTG于2007-09-14 04:16发表的“”:
2.x=16:1;sort(x,pa=14),会发现从第14个数以后,是按顺序排的。[/quote]
NO!
Partial sorting means you only need the kth element to be on its right (sorted) place, whereas anything before or after that element will not necessarily be sorted.
You can think of this as an early-stopped version of quick sort.
e.g.
<br />
> x=sample(99)<br />
> median(x)<br />
[1] 50<br />
> sort(x,pa=50)[40:60]<br />
[1] 35 34 39 28 47 37 26 44 48 49 50 55 64 74 75 89 70 52 76 66 65<br />