МП
Size: a a a
МП
I
МП
МП
МП
def quicksort(l):
if len(l) <= 1:
return l
pivot = l[0]
lt = [x for x in l if x < pivot]
eq = [x for x in l if x == pivot]
gt = [x for x in l if x > pivot]
return quicksort(lt) + eq + quicksort(gt)
МП
МП
((
let rec qsort = function
| [] -> []
| x::xs -> let smaller,larger = List.partition (fun y -> y<=x) xs
qsort smaller @ [x] @ qsort larger
Г
S
((
МП
МП
<|" ?X
<|" ?МП