diff options
Diffstat (limited to 'Semestr 2/racket/solution.rkt')
-rw-r--r-- | Semestr 2/racket/solution.rkt | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/Semestr 2/racket/solution.rkt b/Semestr 2/racket/solution.rkt deleted file mode 100644 index 3643668..0000000 --- a/Semestr 2/racket/solution.rkt +++ /dev/null @@ -1,14 +0,0 @@ -#lang racket - -(provide heapsort) (require "leftist.rkt") - -(define (heapsort xs) - (define (create-heap xs res) - (if (null? xs) - res - (create-heap (cdr xs) (heap-insert (cons (car xs) (car xs)) res)))) - (define (heap-to-list h) - (if (heap-empty? h) - null - (cons (elem-val (heap-min h)) (heap-to-list (heap-pop h))))) - (heap-to-list (create-heap xs empty-heap)))
\ No newline at end of file |