From: xchaos Date: Mon, 12 May 2008 21:29:34 +0000 (+0000) Subject: do not compile yet X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=3fa0c74773fa632501756e88ec11a2929b171bb5;p=svn%2FCll1h%2F.git do not compile yet git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@71 4bb87942-c103-4e5a-b51c-0ebff58f8515 --- diff --git a/demos/trees.c b/demos/trees.c index 44c9ad5..dff0dda 100644 --- a/demos/trees.c +++ b/demos/trees.c @@ -22,24 +22,25 @@ program //grow tree { - void *prev = NULL, *newleaf = leaf; - + void *prev=NULL, *newleaf=leaf; //find where to store - for(leaf=root; leaf && leaf->__key <= newkey ; leaf=leaf->__next) + for(leaf=root; leaf && leaf->__key<=newkey ; leaf=leaf->__next) { - prev = leaf; - if(leaf->__seek && leaf->__seek->key <= newkey) leaf=leaf->__seek; + prev=leaf; + if(leaf->__seek && leaf->__seek->key<=newkey) leaf=leaf->__seek; } - //store new node + leaf=newleaf; if(prev) { - + leaf->__next=prev->__next->__next; + prev->__next=leaf; } else - { - - } + leaf->__next=root; + //auto seek + if(leaf->__next->__next;) + leaf->__seek=leaf->__next->__next; //reindex B+ tree for(leaf=root; leaf->__next ; leaf=leaf->__next)