Guest User

Untitled

a guest
Dec 11th, 2012
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.41 KB | None | 0 0
  1. (define bubble
  2.   (lambda (l cap)
  3.     (cond ((null? (cdr l)) l)
  4.           ((cmp (car l)(cadr l))
  5.            (cons (car l)(bubble (cdr l) cmp))))
  6.           (else (cons (cadr l)(buuble (cons (car l)(cddr l)) cmp)))))
  7.  
  8. (define bubblesort-1
  9.   (lambda (l cmp)
  10.     (define bloop
  11.       (lambda (l k)
  12.         (if (null? k)
  13.             l
  14.             (bloop (bubble l cmp)(cdr k)))))
  15.     (bloop l l)))
Advertisement
Add Comment
Please, Sign In to add comment