[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.6.8 qsort

qsort(array[,func])
:: Sorts an array array.

return
array (The same as the input; Only the elements are exchanged.)
array
array
func
function for comparison

 
[0] qsort(newvect(10,[1,4,6,7,3,2,9,6,0,-1]));
[ -1 0 1 2 3 4 6 6 7 9 ]
[1] def rev(A,B) { return A>B?-1:(A<B?1:0); }
[2] qsort(newvect(10,[1,4,6,7,3,2,9,6,0,-1]),rev);
[ 9 7 6 6 4 3 2 1 0 -1 ]

References
6.3.7 ord, 6.3.2 vars.


This document was generated by root on March, 5 2004 using texi2html