submit2
This commit is contained in:
parent
432e7485ea
commit
f4ce3af790
@ -2,7 +2,11 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "binary_search_tree.h"
|
#include "binary_search_tree.h"
|
||||||
|
node_t *build_tree(int *, size_t );
|
||||||
|
void add_dereva(node_t* , int );
|
||||||
|
void free_tree(node_t *);
|
||||||
|
int *sorted_data(node_t *);
|
||||||
|
int count_size(node_t *);
|
||||||
|
|
||||||
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* first=malloc(sizeof(node_t));
|
node_t* first=malloc(sizeof(node_t));
|
||||||
@ -10,7 +14,7 @@ node_t *build_tree(int *tree_data, size_t tree_data_len){
|
|||||||
first->right=NULL;
|
first->right=NULL;
|
||||||
first->left=NULL;
|
first->left=NULL;
|
||||||
|
|
||||||
for(int i=1; i<tree_data_len; i++){
|
for(unsigned int i=1; i<tree_data_len; i++){
|
||||||
add_dereva( first, tree_data[i]);
|
add_dereva( first, tree_data[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user