Skip to content

Commit 036f4f7

Browse files
author
Miao Mico
committed
修复 b_tree_control_delete_rule;
增加 tree.info.mem_size_key,用于存储 key 的长度; 增加 tree_family_control_get/del_family_member; 修改 tree_family 中的 switch_control 接收 struct tree_famly_s tree 参数,为了适应 b_tree;
1 parent f8fa3b7 commit 036f4f7

16 files changed

Lines changed: 554 additions & 234 deletions

Algorithm/algorithm.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@
2222

2323
/*
2424
*********************************************************************************************************
25-
* CONFIG DEFINES
25+
* DEFINES
2626
*********************************************************************************************************
2727
*/
2828

29+
/* Define the definition of swap algorithm. */
30+
#define ALGORITHM_SWAP(x,y) (x) = (x) ^ (y),(y) = (x) ^ (y),(x) = (x) ^ (y)
31+
2932
/*
3033
*********************************************************************************************************
3134
* DATA TYPES

Algorithm/sort.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void sort_algorithm_control_bubble_sort(struct sort_package_s sort_package,
202202
for (size_t cnt = 0; cnt < sort_package.len - 1; cnt++) {
203203
for (size_t ct = 0; ct < sort_package.len - cnt - 1; ct++) {
204204
if (!sort_algorithm_control_get_value(sort_package, ct, &value_lhs, &value_rhs)) { /* Get the value */
205-
return;
205+
continue;
206206
}
207207

208208
if (compare(value_lhs, value_rhs, sort_package.mem_len)) { /* Compare the value */

Container/avl_tree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* @return void
5151
*/
5252

53-
void avl_tree_control_switch_control(void);
53+
void avl_tree_control_switch_control(struct tree_family_s *tree);
5454

5555
/*
5656
*********************************************************************************************************
@@ -106,7 +106,7 @@ void avl_tree_control_configuration_init(AVL_TREE_TYPEDEF_PPTR tree,
106106
* @return void
107107
*/
108108

109-
void avl_tree_control_switch_control(void)
109+
void avl_tree_control_switch_control(struct tree_family_s *tree)
110110
{
111111
//tree_family_control_get_control(TREE_FAMILY_AVL_TREE, avl_tree_control_node_operator);
112112
}

0 commit comments

Comments
 (0)