Add code
This commit is contained in:
parent
9d2e745be6
commit
3ecd76609c
7 changed files with 574 additions and 0 deletions
13
SelectionSort.rkt
Executable file
13
SelectionSort.rkt
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#lang racket
|
||||
|
||||
(define (selection-sort lst) (
|
||||
cond
|
||||
[(empty? lst) empty]
|
||||
[else (cons
|
||||
(apply min lst)
|
||||
(selection-sort (remove (apply min lst) lst))
|
||||
)
|
||||
]
|
||||
))
|
||||
|
||||
(selection-sort (list 4 7 4 6 1 5 2 9 7))
|
||||
Loading…
Add table
Add a link
Reference in a new issue