some work, not much
authorxchaos <xchaos@4bb87942-c103-4e5a-b51c-0ebff58f8515>
Wed, 30 Apr 2008 17:42:46 +0000 (17:42 +0000)
committerxchaos <xchaos@4bb87942-c103-4e5a-b51c-0ebff58f8515>
Wed, 30 Apr 2008 17:42:46 +0000 (17:42 +0000)
git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@69 4bb87942-c103-4e5a-b51c-0ebff58f8515

demos/trees.c

index 0b8966cf9365ca3c7a3ba00ddca404a29bf885e8..788989ee00e57f8ac5114d34c6a4a78ce98e4c6c 100644 (file)
@@ -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
+    {
+    
+    }
+
+  }
  } 
 }
This page took 0.132449 seconds and 4 git commands to generate.