diff src/llrb/llrbContext.h @ 81:dc6f665bb753

implement delete(tail call). do not work
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Fri, 11 Dec 2015 15:06:20 +0900
parents 618c03f25108
children c13575c3dbe9
line wrap: on
line diff
--- a/src/llrb/llrbContext.h	Mon Nov 30 21:40:50 2015 +0900
+++ b/src/llrb/llrbContext.h	Fri Dec 11 15:06:20 2015 +0900
@@ -1,7 +1,7 @@
 /* Context definition for llrb example */
 #include "stack.h"
 
-#define ALLOCATE_SIZE 100
+#define ALLOCATE_SIZE 1000
 
 enum Code {
     Code1,
@@ -17,37 +17,42 @@
     Replace,
     Insert,
     Compare,
-    Create,
     RotateL,
     RotateR,
-    ColorFlip,
-    FixUp,
-    SetRoot,
-    ChangeRef,
-    Balance1,
-    Balance2,
-    Balance3,
-    Balance4,
-    Balance4_1,
-    Balance4_2,
-    Balance5,
+    SetTree,
+    InsertCase1,
+    InsertCase2,
+    InsertCase3,
+    InsertCase4,
+    InsertCase4_1,
+    InsertCase4_2,
+    InsertCase5,
+    InsertCase5_1,
     Get,
-    FindMin,
+    Search,
     Delete,
+    Delete1,
+    Delete2,
+    Delete3,
     Replace_d1,
     Replace_d2,
-    Replace_d3,
-    Replace_d4,
-    MoveRedL1,
-    MoveRedL2,
-    MoveRedL3,
-    MoveRedR1,
-    MoveRedR2,
-    DeleteMin1,
-    DeleteMin2,
+    FindMax1,
+    FindMax2,
+    DeleteCase1,
+    DeleteCase2,
+    DeleteCase3,
+    DeleteCase4,
+    DeleteCase5,
+    DeleteCase6,
     Exit,
 };
 
+enum Relational {
+    EQ,
+    GT,
+    LT,
+};
+
 enum UniqueData {
     Allocate,
     Tree,
@@ -80,7 +85,7 @@
         enum Code next;
         struct Node* root;
         struct Node* current;
-        struct Node* prev;
+        struct Node* deleted;;
         int result;
     } tree;
     struct Node {