Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Jacob Smith
- ;25 April, 2017
- ;CS 424-01
- ;This program finds the minimum and maximum of a given list
- (define (minmax lst)
- (if (null? lst) (display "Results-> [" display min(lst) display max(lst) display "]") (display "Null List")
- )
- )
- (define (min lst)
- (if (> (car lst) (min(cdr lst))) (min(cdr lst)) car)
- )
- (define (max lst)
- (if (> (car lst) (max(cdr lst))) car (max(cdr lst)))
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement