Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (getMaxWrapper list currMax)
- (if (null? list ) currMax
- (if (> (car list) currMax)
- (getMaxWrapper (cdr list) (car list))
- (getMaxWrapper (cdr list) currMax))))
- (define (getMax list)
- (getMaxWrapper list (car list)))
- (define (getMinWrapper list currMin)
- (if (null? list) currMin
- (if (< (car list) currMin)
- (getMinWrapper (cdr list) (car list))
- (getMinWrapper (cdr list) currMin))))
- (define (getMin list)
- (getMinWrapper list (car list)))
- (define (getRes matrix)
- (getMin (map getMax matrix)))
- (define (im matrix curMat)
- (if (null? matrix) curMat
- (if (null? (car matrix)) curMat
- (im (map cdr matrix) (append curMat (list (map car matrix)))))))
- (if (null? (car '(()()))) 1 2)
- (define matrix '((1 2 3 4 )((4 5 6 7))))
- ;(append '() (list '(1 4)) (list '(2 3)) (list '(3 6)))
- (im matrix '())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement