Skip to content

Commit ece079d

Browse files
abhisagart2013anurag
authored andcommitted
racket selection sort (hacktoberfest17#1677)
1 parent 8b1e768 commit ece079d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
#lang racket
3+
(define (selection-sort xs)
4+
(cond [(empty? xs) '()]
5+
[else (define x0 (apply min xs))
6+
(cons x0 (selection-sort (remove x0 xs)))]))

0 commit comments

Comments
 (0)