Notes
This function is in beta test. Please help improve it in the issues
here.
Hints
Your answer may be identical to the JOJ answer in the first several lines.
However, the main problem you meet now is Runtime Error. And the exit code of your program is -6, which should be 0.
Please double check your code to solve this problem and try again.
Your Answer
Entering BinaryTree val = 5 Entering BinaryTree val = 15 Entering BinaryTree val = 10 Entering BinaryTree val = 10 left.root = 0x563c1da7b220 right.root = 0x563c1da7b240 Test 1: In-order Traversal: Entering operator<< Entering inOrderPrint Entering inOrderPrint Entering inOrderPrint 5 Entering inOrderPrint 10 Entering inOrderPrint Entering inOrderPrint 15 Entering inOrderPrint Entering ~BinaryTree Entering removeAll Entering removeAll Entering removeAll root is nullptr Entering removeAll root is nullptr Entering removeAll Entering removeAll root is nullptr Entering removeAll root is nullptr Entering ~BinaryTree Entering removeAll Entering removeAll Entering removeAll root is nullptr Entering removeAll root is nullptr Entering removeAll root is nullptr
JOJ Answer
Test 1: In-order Traversal: 5 10 15