Sort an array only using recursion Your task is to write a function that sorts an array.



Your function:


Cannot call other functions (excluding itself, of course);  
Must receive an array of integers as input, and it must return the ordered array. Feel free to add other parameters as input, if you need them.
Cannot use any kind of loop (for, while...) except recursion;  
Cannot access the internet;
Can be overloaded if you need it. 




Code-Golf here. Shortest code wins, as usual.

Happy coding!
APL (36)

{⍵≡⍬:⍬⋄(∇z/m),p,∇m/⍨~z←(p←⊃⍵)≥m←1↓⍵}


It's quicksort:


⍵≡⍬: if the list is equal to the empty list
:⍬: then return the empty list
⋄: otherwise:

m←1↓⍵: m is the list minus its first element
p←⊃⍵: p (pivot) is the first element
z←(p←⊃⍵)≥m: z is a bitmask of those values of m that are smaller than p.
∇m/⍨~z select the inverse of z from m (= larger numbers) , and sort it recursively 
p,: pivot
∇z/m: select z from m (= smaller or equal numbers) and sort it recursively