Browse Source

Initializtion

master
Kozar 3 weeks ago
parent
commit
65f1c89f27
  1. 6
      a3/binary_search_tree.c

6
a3/binary_search_tree.c

@ -25,10 +25,14 @@ node_t *build_tree(int *tree_data, size_t tree_data_len) {
current = current->left;
} else {
current = current->right;
}
}
}
current = malloc(sizeof(node_t));
if (current == NULL) {
free_tree(root);
return NULL;
}
current->data = tree_data[i];
current->left = NULL;
current->right = NULL;

Loading…
Cancel
Save