Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (addition graf)
- (define helplst (build-list (car graf) values))
- (define (myfoldl lst i result)
- (if (empty? lst) result
- (myfoldl (cdr lst) (+ i 1) (append (find (cdar lst) '() i helplst) result))))
- (myfoldl (cdr graf) 0 '()))
- (define (find lst result i helplst)
- (if (or(empty? helplst) (>=(car helplst) i)) result
- (if (not(member (car helplst) lst))
- (find lst (cons (cons i (car helplst)) result) i (cdr helplst))
- (find lst result i (cdr helplst)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement