From 3c9770e9d1ec54a666c92d90953fa082743c6523 Mon Sep 17 00:00:00 2001 From: erana Date: Sat, 21 Jan 2012 13:40:11 +0900 Subject: [PATCH] xanadu - btree --- scsh/xanadu/b-tree.scm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scsh/xanadu/b-tree.scm b/scsh/xanadu/b-tree.scm index b1ff37d..97d199e 100644 --- a/scsh/xanadu/b-tree.scm +++ b/scsh/xanadu/b-tree.scm @@ -94,9 +94,9 @@ ((cond ((>= i (- len 1));;last node (do ((j 0 (+ j 1))) ((= j len) (display "node not found.") 0) - (add-rec str (vector-ref j tree)))) - ((and (string? str (vector-ref tree (+ i 1)))) + (search-rec str (vector-ref j tree)))) + ((and (string? str (((vector-ref tree (+ i 1))'get-data)))) (display "node not found in tree.") 0) ((string=? str (vector-ref tree i)) (display "string found in tree.") str) @@ -123,9 +123,7 @@ ))) ((string=? str (vector-ref tree i)) (set! i (vector-length tree))) - (else (display "never reached.")))) - ))) - + (else (display "never reached."))))) (define (add str) (add-rec *tree))