arbre binaire inversé c
void reverse_tree(tree_node_t* root) {
if (root != NULL) {
// Reverse left and right sub-tree
reverse_tree(root->left_child);
reverse_tree(root->right_child);
// Reverse two child nodes
tree_node_t *temp = root->right_child;
root->right_child = root->left_child;
root->left_child = temp;
}
}
Filip Výrostko