The function sort sorts a list into non-descending order:
(define (sort-once l) (cond ((< (length l) 2) l) ((< (car l) (cadr l)) (cons (car l) (sort-once (cdr l)))) (else (cons (cadr l) (sort-once (cons (car l) (cddr l))))))) (define (sort l) ((repeated sort-once (- (length l) 1)) l))What is the order of growth of sort? |