Skip to content

Commit 4271c76

Browse files
committed
modify
1 parent 0faf174 commit 4271c76

2 files changed

Lines changed: 3 additions & 43 deletions

File tree

Algorithm_full_features/BTree-simpleImplementation/btree.cpp

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -435,45 +435,7 @@ Status PrintBTree(BTree t)
435435
return OK;
436436
}
437437

438-
void Test1()
439-
{
440-
system("color 70");
441-
BTNode *t = NULL;
442-
Result s; //设定查找结果
443-
int j, n = 15;
444-
KeyType k;
445-
KeyType a[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 };
446-
printf("创建一棵%d阶B树:\n", m);
447-
for (j = 0; j < n; j++) { //逐一插入元素
448-
s = SearchBTree(t, a[j]);
449-
if (s.tag == 0)
450-
InsertBTree(t, s.i, a[j], s.pt);
451-
printf(" 第%d步,插入元素%d:\n ", j + 1, a[j]);
452-
PrintBTree(t);
453-
}
454-
455-
printf("\n");
456-
printf("删除操作:\n"); //删除操作
457-
k = 9;
458-
BTreeDelete(t, k);
459-
printf(" 删除%d:\n ", k);
460-
printf(" 删除后的B树: \n");
461-
PrintBTree(t);
462-
printf("\n");
463-
464-
k = 1;
465-
BTreeDelete(t, k);
466-
printf(" 删除%d:\n ", k);
467-
printf(" 删除后的B树: \n");
468-
PrintBTree(t);
469-
printf("\n");
470-
471-
printf(" 递归释放B树\n"); //递归释放B树
472-
DestroyBTree(t);
473-
PrintBTree(t);
474-
}
475-
476-
void Test2()
438+
void Test()
477439
{
478440
int i, k;
479441
system("color 5E");
@@ -525,6 +487,6 @@ void Test2()
525487
}
526488

527489
int main() {
528-
Test2();
490+
Test();
529491
return 0;
530492
}

Algorithm_full_features/BTree-simpleImplementation/btree.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ Status Traverse(BTree t, LinkList L, int newline, int sum);
115115
// 打印 B 树
116116
Status PrintBTree(BTree t);
117117

118-
void Test1();
119-
120-
void Test2();
118+
void Test();
121119

122120
#endif

0 commit comments

Comments
 (0)