mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-13 18:00:18 +08:00
build
This commit is contained in:
@@ -1074,7 +1074,7 @@ comments: true
|
||||
} ArrayBinaryTree;
|
||||
|
||||
/* 构造函数 */
|
||||
ArrayBinaryTree *createArrayBinaryTree(int *arr, int arrSize) {
|
||||
ArrayBinaryTree *newArrayBinaryTree(int *arr, int arrSize) {
|
||||
ArrayBinaryTree *abt = (ArrayBinaryTree *)malloc(sizeof(ArrayBinaryTree));
|
||||
abt->tree = malloc(sizeof(int) * arrSize);
|
||||
memcpy(abt->tree, arr, sizeof(int) * arrSize);
|
||||
@@ -1082,6 +1082,12 @@ comments: true
|
||||
return abt;
|
||||
}
|
||||
|
||||
/* 析构函数 */
|
||||
void delArrayBinaryTree(ArrayBinaryTree *abt) {
|
||||
free(abt->tree);
|
||||
free(abt);
|
||||
}
|
||||
|
||||
/* 节点数量 */
|
||||
int size(ArrayBinaryTree *abt) {
|
||||
return abt->size;
|
||||
|
||||
Reference in New Issue
Block a user