sync from Atlas

This commit is contained in:
Luciano Ramalho
2021-09-20 10:37:26 -03:00
parent 6527037ae7
commit 2f2f87d4fb
16 changed files with 1730 additions and 115 deletions

View File

@@ -0,0 +1,17 @@
(define (quicksort lst)
(if (null? lst)
lst
(begin
(define pivot (car lst))
(define rest (cdr lst))
(append
(quicksort
(filter (lambda (x) (< x pivot)) rest))
(list pivot)
(quicksort
(filter (lambda (x) (>= x pivot)) rest)))
)
)
)
(display
(quicksort (list 2 1 6 3 4 0 8 9 7 5)))