Update test_rbtree.c
This commit is contained in:
parent
3e2208cbec
commit
3417137798
|
@ -1,63 +1,3 @@
|
|||
// #include <stdio.h>
|
||||
// #include "rbtree.h"
|
||||
// #include "rbtree.c"
|
||||
|
||||
// #define IF_INSERT 1 // "插入节点"flag
|
||||
// #define IF_DELETE 1 // "删除节点"flag
|
||||
// #define LENGTH(a) ( (sizeof(a)) / (sizeof(a[0])) )
|
||||
|
||||
// void main()
|
||||
// {
|
||||
// int a[] = {10, 150, 70, 0, 190, 270, 20, 50, 80};
|
||||
// int i, ilen=LENGTH(a);
|
||||
// RBRoot *root=NULL;
|
||||
|
||||
// root = create_rbtree();
|
||||
// printf("red black tree 原始数据: ");
|
||||
// for(i=0; i<ilen; i++)
|
||||
// printf("%d ", a[i]);
|
||||
// printf("\n");
|
||||
|
||||
// for(i=0; i<ilen; i++)
|
||||
// {
|
||||
// RBTreeInsert(root, a[i]);
|
||||
// #if IF_INSERT
|
||||
// printf("添加节点: %d\n", a[i]);
|
||||
// printf("树的结构信息: \n");
|
||||
// print_rbtree(root);
|
||||
// printf("\n");
|
||||
// #endif
|
||||
// }
|
||||
|
||||
// printf("树的结构信息: \n");
|
||||
|
||||
// printf("\n== 中序遍历: ");
|
||||
// RBTreeTraversal(root);
|
||||
|
||||
|
||||
// #if IF_DELETE
|
||||
// for(i=0; i<ilen; i++)
|
||||
// {
|
||||
// RBTreeDelete(root, a[i]);
|
||||
|
||||
// printf("== 删除节点: %d\n", a[i]);
|
||||
// if (root)
|
||||
// {
|
||||
// printf("== 树的详细信息: \n");
|
||||
// print_rbtree(root);
|
||||
// printf("\n");
|
||||
// }
|
||||
// }
|
||||
// #endif
|
||||
|
||||
// destroy_rbtree(root);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include "rbtree.h"
|
||||
#include "rbtree.c"
|
||||
|
|
Loading…
Reference in New Issue