Order by pair comparisons: Difference between revisions
m
→{{header|J}}: make quicksort implementation be general (taking comparison function as an argument)
(J) |
m (→{{header|J}}: make quicksort implementation be general (taking comparison function as an argument)) |
||
Line 917:
if. 1 >: #y do. y
else.
(u quicksort y
end.
}}
Line 927:
}}
coord=. x ,&(items&i.) y
lt=. LT {~<coord
Line 940:
items=: ~.y
LT=: <:%=i.#items
askless quicksort y
}}</lang>
|