Fix treap-values, which had been returning the keys (!)
This commit is contained in:
parent
309ca6f349
commit
85450362fb
|
@ -188,7 +188,7 @@
|
||||||
(let walk ((n (treap-root t)) (acc '()))
|
(let walk ((n (treap-root t)) (acc '()))
|
||||||
(match n
|
(match n
|
||||||
[(L) acc]
|
[(L) acc]
|
||||||
[(N k _ _ left right) (walk left (cons k (walk right acc)))])))
|
[(N _ v _ left right) (walk left (cons v (walk right acc)))])))
|
||||||
|
|
||||||
(define (treap-fold t f seed)
|
(define (treap-fold t f seed)
|
||||||
(let walk ((n (treap-root t)) (acc seed))
|
(let walk ((n (treap-root t)) (acc seed))
|
||||||
|
|
Loading…
Reference in New Issue