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 lessu sel e),(y =sel e),u quicksort y lessu~ sel e=.y{~?#y
end.
}}
Line 927:
}}
 
lessaskless=: {{
coord=. x ,&(items&i.) y
lt=. LT {~<coord
Line 940:
items=: ~.y
LT=: <:%=i.#items
askless quicksort y
}}</lang>
 
6,962

edits