- (define (sort alon)
- (cond
- [empty alon) empty]
- [else (insert (first alon)(sort (rest alon)))]))
- (define (insert n alon)
- (cond
- [(empty? alon) ...]
- [else ... (first alon) ... (insert n (rest alon)) ...]))
=============================================================
(define (a-sort a-list)
(cond
[(empty? a-list) empty]
[else (insert (first a-list ) (a-sort (rest a-list)))]))
(define (insert a a-list)
(cond
[(empty? a-list) (cons a empty)]
[else (cond
[(< a (first a-list)) (cons (first a-list)(insert a (rest a-list)))]
[else (cons a a-list)])]))