Advertisement
PonaFly

del peaks of graph

Apr 27th, 2016
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. (define (del graph peaks) ;test (del '((1 2 ) (3 1) (0 2)) '(1 3 2)) (del '((1 2 ) (3 1) (0 2)) '(1 3))
  2. (if (empty? peaks) graph
  3. (del (map (λ(p) (cond
  4. ( (equal? (car p) (car peaks)) (list (- (car p) 1) (cadr p))) ;кадр-это второй эелемент в списке,а не кдр(кдр-список из последнего элемента)
  5. ( (equal? (cadr p) (car peaks)) (list (car p)(- (cadr p) 1)))
  6. (else p))) graph) (cdr peaks))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement