rewrwrewr
This commit is contained in:
parent
f644616cc4
commit
e40b7d33ad
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user