(define (quicksort lst op) (if (null? lst) lst (let* ((one (car lst)) (left (filter (lambda (x) (op x one)) (cdr lst))) (right (filter (lambda (x) (not (op x one))) (cdr lst)))) (append (quicksort left op) (list one) (quicksort right op)))))
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter