迭代器:前序遍历right优先测试通过

This commit is contained in:
建峰 2024-09-02 11:38:19 +08:00
parent c8f39bf53a
commit e6828c2cb0
3 changed files with 341 additions and 297 deletions

View File

@ -1,35 +1,35 @@
# unicstl
## 简介
全称: Universal C standard library
## 简介
全称: Universal C standard library
基于C语言实现的通用C库。包含常用数据结构和算法
基于C语言实现的通用C库。包含常用数据结构和算法
> 标准:--std=c99
> 标准:--std=c99
[数据结构详细说明](http://wenjianfeng.top)
[数据结构详细说明](http://wenjianfeng.top)
## 数据结构
|数据结构 | 原理 |说明 |
## 数据结构
|数据结构 | 原理 |说明 |
|---|---|---|
| **stack** | | **栈** |
| stack_init | 链表 | |
| stack_init2 | 动态数组 | |
| **list** | | **列表**
| list_init2 | 动态数组 | |
| **queue** | | **队列**
| queue_init | 单向链表 | |
| queue_init2 | 数组 | FIFO/空/满 |
| **deque** | |**双端队列** |
| deque_init | 双向循环链表 | |
| **tree** | |**树** |
| tree_avl_init | 二叉搜索树 | AVL树 |
| tree_rb_init | 二叉搜索树 | 红黑树 |
| **heap** | |**堆** |
| heap_init2 | 数组 | 最大堆/最小堆 |
| **stack** | | **栈** |
| stack_init | 链表 | |
| stack_init2 | 动态数组 | |
| **list** | | **列表**
| list_init2 | 动态数组 | |
| **queue** | | **队列**
| queue_init | 单向链表 | |
| queue_init2 | 数组 | FIFO/空/满 |
| **deque** | |**双端队列** |
| deque_init | 双向循环链表 | |
| **tree** | |**树** |
| tree_avl_init | 二叉搜索树 | AVL树 |
| tree_rb_init | 二叉搜索树 | 红黑树 |
| **heap** | |**堆** |
| heap_init2 | 数组 | 最大堆/最小堆 |
## 版本
| 版本 | 说明 |
## 版本
| 版本 | 说明 |
|:----:|:----:|
| 0.xx.xx | 测试版本 |
| 0.xx.xx | 测试版本 |

File diff suppressed because it is too large Load Diff

View File

@ -558,8 +558,9 @@ static void test_tree_iter(void)
TEST_ASSERT_EQUAL_INT_ARRAY(expected_int_array[i], buff, count);
}
tree->order(tree, true);
printf("\n\nactual data = \n");
tree->breadth(tree, tree->_root);
tree->preorder(tree, tree->_root);
printf("\n");
// set order
@ -567,7 +568,8 @@ static void test_tree_iter(void)
// tree->set_order(tree, ORDER_LEFT_IN);
// tree->set_order(tree, ORDER_LEFT_POST);
// tree->set_order(tree, ORDER_LEFT_BREADTH);
tree->set_order(tree, ORDER_RIGHT_BREADTH);
tree->set_order(tree, ORDER_RIGHT_PRE);
// tree->set_order(tree, ORDER_RIGHT_BREADTH);
printf("\n ----- iter data -----\n");
for (count = 0, iter = tree->begin(tree); iter != tree->end(tree); iter = tree->next(tree))
{