rewrwrewr

This commit is contained in:
Michal Utľák 2024-04-23 19:55:17 +02:00
parent f644616cc4
commit e40b7d33ad

View File

@ -41,15 +41,15 @@ int *sorted_data(node_t *tree) {
tree = tree->left;
}
tree = stack[--stack_top];
sorted_array[index++] = tree->data;
tree = tree->right;
if (stack_top > 0) {
tree = stack[--stack_top];
sorted_array[index++] = tree->data;
tree = tree->right;
}
}
return sorted_array;
}
node_t *build_tree(int *tree_data, size_t tree_data_len) {
if (tree_data == NULL || tree_data_len == 0) {
return NULL;