-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_insert.c
28 lines (25 loc) · 872 Bytes
/
test_insert.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
* test_insert.c
*
* Created on: Nov 23, 2018
* Author: wei100
*/
#include "zst.h"
void test_insert(node* postorder_traversal_head) {
while(postorder_traversal_head != NULL) {
if(postorder_traversal_head->leaf_node_label == -1) {
insert_inv_left(postorder_traversal_head, postorder_traversal_head->left);
if(postorder_traversal_head->right != NULL) {
insert_inv_right(postorder_traversal_head, postorder_traversal_head->right);
}
parity_adjust(postorder_traversal_head);
}
postorder_traversal_head = postorder_traversal_head->next;
}
}
void test_adjust(node* postorder_traversal_head) {
while(postorder_traversal_head != NULL) {
zero_skew_adjust(postorder_traversal_head);
postorder_traversal_head = postorder_traversal_head->next;
}
}