annotate Paper/src/CopyRedBlackTree.h @ 46:9baf70df56fa

copy algo
author matac42 <matac@cr.ie.u-ryukyu.ac.jp>
date Mon, 29 Jan 2024 13:41:22 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
46
9baf70df56fa copy algo
matac42 <matac@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 typedef struct RedBlackTree <> impl Tree {
9baf70df56fa copy algo
matac42 <matac@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 struct Node* root;
9baf70df56fa copy algo
matac42 <matac@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 struct Node* current; // reading node of original tree;
9baf70df56fa copy algo
matac42 <matac@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 struct Node* previous; // parent of reading node of original tree;
9baf70df56fa copy algo
matac42 <matac@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 struct Node* newNode; // writing node of new tree;
9baf70df56fa copy algo
matac42 <matac@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 struct Node* parent;
9baf70df56fa copy algo
matac42 <matac@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 struct Node* grandparent;
9baf70df56fa copy algo
matac42 <matac@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 struct Stack* nodeStack;
9baf70df56fa copy algo
matac42 <matac@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 struct Stack* toStack;
9baf70df56fa copy algo
matac42 <matac@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 __code findNodeNext(...);
9baf70df56fa copy algo
matac42 <matac@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 int result;
9baf70df56fa copy algo
matac42 <matac@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 int copied;
9baf70df56fa copy algo
matac42 <matac@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 } RedBlackTree;