union find fixing
This commit is contained in:
parent
5ff41c40f3
commit
df1ef5b693
|
@ -31,7 +31,11 @@
|
|||
;; Returns the node that's associated with this element.
|
||||
(: lookup-node (forest Symbol -> node))
|
||||
(define (lookup-node a-forest an-elt)
|
||||
(hash-ref (forest-ht a-forest) an-elt))
|
||||
(unless (hash-has-key? (forest-ht a-forest) an-elt)
|
||||
(make-set a-forest an-elt))
|
||||
(hash-ref (forest-ht a-forest)
|
||||
an-elt))
|
||||
|
||||
|
||||
|
||||
;; make-set: forest X -> void
|
||||
|
|
Loading…
Reference in New Issue
Block a user