From: xchaos Date: Wed, 30 Apr 2008 17:42:46 +0000 (+0000) Subject: some work, not much X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=a68153bf02baf64e3b6cbf3da18308636beef4f3;p=svn%2FCll1h%2F.git some work, not much git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@69 4bb87942-c103-4e5a-b51c-0ebff58f8515 --- 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 + { + + } + + } } }