xanadu - xml-tree
This commit is contained in:
parent
59eeec4637
commit
760a8cbe40
|
@ -156,6 +156,14 @@
|
||||||
(do ((i 0 (+ i 1)))
|
(do ((i 0 (+ i 1)))
|
||||||
((cond ((not side-tree)
|
((cond ((not side-tree)
|
||||||
#f)
|
#f)
|
||||||
|
((= i (vector-length side-tree))
|
||||||
|
(do ((i 0 (+ i 1)))
|
||||||
|
((= i (vector-length side-tree))0)
|
||||||
|
(let ((side-tree-node (vector-ref i side-tree)))
|
||||||
|
(cond ((not (not side-tree-node))
|
||||||
|
#f)
|
||||||
|
(else (add-rec str side-tree-node)))));;NOTE add-rec not the other add-rec
|
||||||
|
)
|
||||||
((let* ((data (((vector-ref side-tree i) 'get-data)))
|
((let* ((data (((vector-ref side-tree i) 'get-data)))
|
||||||
(left-and-right (vector-median side-tree));;FIXME right also descend
|
(left-and-right (vector-median side-tree));;FIXME right also descend
|
||||||
(new-node (make-b-tree-node
|
(new-node (make-b-tree-node
|
||||||
|
@ -181,17 +189,12 @@
|
||||||
((new-node 'set-data!) str)
|
((new-node 'set-data!) str)
|
||||||
(vector-set! side-tree i new-node)
|
(vector-set! side-tree i new-node)
|
||||||
))))
|
))))
|
||||||
;;((= i len)
|
((let ((data (((vector-ref side-tree i) 'get-data))))
|
||||||
;; (display "node not added .") 0)
|
(string=? data str) ;;NOTE duplicates possible
|
||||||
|
(display "b-tree - node already exists.")
|
||||||
(else (display "b-tree add - never reached.")))))
|
0))
|
||||||
(do ((i 0 (+ i 1)))
|
(else (display "b-tree - add - never reached.")))))
|
||||||
((= i (vector-length side-tree))0)
|
)
|
||||||
(let ((side-tree-node (vector-ref i side-tree)))
|
|
||||||
(cond ((not (not side-tree-node))
|
|
||||||
#f)
|
|
||||||
(else (add-rec str side-tree-node)))));;NOTE add-rec not the other add-rec
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue