Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
(define (bubble-sort x ??)
|
||||
(define (sort-step l)
|
||||
(if (or (null? l) (null? (cdr l)))
|
||||
l
|
||||
(if (?? (car l) (cadr l))
|
||||
(cons (cadr l) (sort-step (cons (car l) (cddr l))))
|
||||
(cons (car l) (sort-step (cdr l))))))
|
||||
(let loop ((i x))
|
||||
(if (equal? i (sort-step i))
|
||||
i
|
||||
(loop (sort-step i)))))
|
||||
|
||||
(print
|
||||
(bubble-sort (list 1 3 5 9 8 6 4 3 2) >))
|
||||
(print
|
||||
(bubble-sort (iota 100) >))
|
||||
(print
|
||||
(bubble-sort (iota 100) <))
|
||||
Loading…
Add table
Add a link
Reference in a new issue