for my study I need to explain the function of Quicksort programmed in Common Lisp. I am honest, I really don't know how to work with Common Lisp. I got a code from the internet (for my professer it is okay to use the code from the internet) which solves the problem of sorting a list of numbers.
I really don't understand this code, can somebody please explain it to me, what it exacly does?
Thanks so far!!
(defun quick-sort (list)
(if (cdr list)
(let ((pivot (car list)))
(flet ((filter (operator)
(remove-if-not
(lambda (n) (funcall operator n pivot))
list)))
(append (quick-sort (filter #'<))
(filter #'=)
(quick-sort (filter #'>)))))
list))