22 lines
439 B
C
22 lines
439 B
C
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
#include "binary_search_tree.h"
|
|
|
|
node_t *build_tree(int *tree_data, size_t tree_data_len){
|
|
|
|
node_t *koren = (node_t *)malloc(sizeof(node_t));
|
|
|
|
if(tree_data == NULL || tree_data_len == 0){
|
|
return 0;
|
|
}
|
|
|
|
if(tree_data != NULL && tree_data_len != 0){
|
|
koren->data = tree_data[0];
|
|
koren->left = (node_t *)tree_data[0];
|
|
}
|
|
|
|
return koren;
|
|
}
|
|
|