rewrwrewr
This commit is contained in:
parent
f644616cc4
commit
e40b7d33ad
@ -41,15 +41,15 @@ int *sorted_data(node_t *tree) {
|
|||||||
tree = tree->left;
|
tree = tree->left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stack_top > 0) {
|
||||||
tree = stack[--stack_top];
|
tree = stack[--stack_top];
|
||||||
sorted_array[index++] = tree->data;
|
sorted_array[index++] = tree->data;
|
||||||
|
|
||||||
tree = tree->right;
|
tree = tree->right;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return sorted_array;
|
return sorted_array;
|
||||||
}
|
}
|
||||||
|
|
||||||
node_t *build_tree(int *tree_data, size_t tree_data_len) {
|
node_t *build_tree(int *tree_data, size_t tree_data_len) {
|
||||||
if (tree_data == NULL || tree_data_len == 0) {
|
if (tree_data == NULL || tree_data_len == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user