⍝ Quicksort — the classic Roger Hui one-liner ⍝ ⍝ Q ← {1≥≢⍵:⍵ ⋄ (∇⍵⌿⍨⍵
p←⍵⌷⍨?≢⍵} ⍝ ⍝ Read right-to-left: ⍝ ?≢⍵ : pick a random index in 1..length ⍝ ⍵⌷⍨… : take that element as pivot p ⍝ ⍵>p : boolean — elements greater than pivot ⍝ ∇⍵⌿⍨… : recursively sort the > partition ⍝ (p=⍵)/⍵ : keep elements equal to pivot ⍝ ⍵
p}