From a68153bf02baf64e3b6cbf3da18308636beef4f3 Mon Sep 17 00:00:00 2001 From: xchaos Date: Wed, 30 Apr 2008 17:42:46 +0000 Subject: [PATCH] some work, not much git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@69 4bb87942-c103-4e5a-b51c-0ebff58f8515 --- demos/trees.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/demos/trees.c b/demos/trees.c index 0b8966c..788989e 100644 --- a/demos/trees.c +++ b/demos/trees.c @@ -21,16 +21,23 @@ program leaf->__key=newkey; //grow tree - for(leaf=root; leaf && leaf->__key <= newkey ; leaf=leaf->__next) { - if(leaf->__seek->key <= newkey) - { - - } - else - { - - } - } + void *prev = NULL, *newleaf = leaf; + for(leaf=root; leaf && leaf->__key <= newkey ; leaf=leaf->__next) + { + prev = leaf; + if(leaf->__seek && leaf->__seek->key <= newkey) leaf=leaf->__seek; + } + + if(prev) + { + + } + else + { + + } + + } } } -- 2.30.2