Each tree has its own characteristics, which I will not describe in detail, since countless Internet resources have done it for me.
You need to use the level_order_print() function. But do not confuse it with the order_print() function, it outputs the elements of the tree in order(from smaller to larger).
Next, simply restore the tree according to the simplest rules of a binary tree(>= - to the right, < - to the left), abstracting from the type of tree.
In our example, we insert an array of numbers {100, 50, 150, 25, 55, 175, 125, 300, 1000}, and then we delete the values 150, 50 and 1000.
What will happen to a simple search tree after all the above actions:
To learn more about the implementation of each of the trees and their brief description, follow these paths (I recommend in this order):
trees/binary-tree
trees/avl-binary-tree
trees/red-black-tree
trees/splay-tree
Each folder will show the trees before and after deleting the items and briefly describe their properties
From the root folder "different-trees" type the following commands:
cmake -S . -B build
make --build build
cd build/
./comparison
If you did everything right, then you will get this result: