From 3fa0c74773fa632501756e88ec11a2929b171bb5 Mon Sep 17 00:00:00 2001 From: xchaos Date: Mon, 12 May 2008 21:29:34 +0000 Subject: [PATCH] do not compile yet git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@71 4bb87942-c103-4e5a-b51c-0ebff58f8515 --- demos/trees.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) 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) -- 2.30.2