Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (heapsort lista)
- (define (wstaw xs)
- (if (= (length xs) 0)
- leaf
- (heap-insert (make-elem (car xs) (car xs)) (wstaw (cdr xs)))))
- (define (wynik h)
- (if (heap-empty? h)
- (list)
- (append (list (elem-val (heap-min h))) (wynik (heap-pop h)))))
- (wynik (wstaw lista))
- )
- (define x (list 2 3 1))
- (define y (list))
- (define z (list 2 2 2 3 1 0 5 4 7))
- (heapsort x)
- (heapsort y)
- (heapsort z)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement