neviem
This commit is contained in:
parent
6073724ccc
commit
372af93550
@ -3,6 +3,17 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "binary_search_tree.h"
|
#include "binary_search_tree.h"
|
||||||
|
|
||||||
|
void free_tree(node_t *tree) {
|
||||||
|
if (tree == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
free_tree(tree->left);
|
||||||
|
free_tree(tree->right);
|
||||||
|
|
||||||
|
free(tree);
|
||||||
|
}
|
||||||
|
|
||||||
node_t *build_tree(int *tree_data, size_t tree_data_len){
|
node_t *build_tree(int *tree_data, size_t tree_data_len){
|
||||||
|
|
||||||
node_t *koren = (node_t *)malloc(sizeof(node_t));
|
node_t *koren = (node_t *)malloc(sizeof(node_t));
|
||||||
|
Loading…
Reference in New Issue
Block a user