(define (split-high lst) (reverse(list-tail (reverse lst) (inexact->exact (floor (/ (length lst) 2)))))) (define (split-low lst) (list-tail lst (inexact->exact (ceiling (/ (length lst) 2))))) (define (merge listA listB) (cond ((and (null? listA) (null? listB)) '()) ((null? listA) listB) ((null? listB) listA) ((<= (car listA) (car listB)) (cons (car listA) (merge (cdr listA) listB))) (else (cons (car listB) (merge (cdr listB) listA))))) (define (merge-sort lst) (cond ((null? lst) '()) ((= (length lst) 1) lst) (else (merge (merge-sort (split-high lst)) (merge-sort (split-low lst)))))) (merge-sort `(3 2 1))