Mercurial > hg > Gears > GearsAgda
comparison src/llrb/llrbContext.h @ 21:737a900518be
implement insert
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 28 Apr 2015 14:34:59 +0900 |
parents | 324c44f2076f |
children | 4c3c0ad4a75d |
comparison
equal
deleted
inserted
replaced
20:324c44f2076f | 21:737a900518be |
---|---|
1 /* Context definition for llrb example */ | 1 /* Context definition for llrb example */ |
2 | 2 |
3 enum Code { | 3 enum Code { |
4 Code1, | 4 Code1, |
5 Code2, | 5 Code2, |
6 Code3, | |
6 Allocate, | 7 Allocate, |
7 Put, | 8 Put, |
8 Insert, | 9 InsertD, |
10 InsertU, | |
9 Exit, | 11 Exit, |
10 }; | 12 }; |
11 | 13 |
12 enum Color { | 14 enum Color { |
13 Red, | 15 Red, |
23 int dataSize; | 25 int dataSize; |
24 union Data **data; | 26 union Data **data; |
25 }; | 27 }; |
26 | 28 |
27 union Data { | 29 union Data { |
30 long count; | |
28 struct Node { | 31 struct Node { |
29 int key; | 32 int key; |
30 int value; | 33 int value; |
31 enum Color color; | 34 enum Color color; |
35 union Data* parent; | |
32 union Data* left; | 36 union Data* left; |
33 union Data* right; | 37 union Data* right; |
34 } node; | 38 } node; |
35 struct Allocate { | 39 struct Allocate { |
36 long size; | 40 long size; |