Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==53304==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000000c at pc 0x55d31c226c67 bp 0x7ffc59cf8150 sp 0x7ffc59cf8140 READ of size 4 at 0x60200000000c thread T0 #0 0x55d31c226c66 in BinaryTree::inOrderTraversal() const /in/ex6.cpp:123 #1 0x55d31c235799 in test26() /in/compile/TestFunctions.cpp:343 #2 0x55d31c238cf2 in std::_Function_handler<void (), void (*)()>::_M_invoke(std::_Any_data const&) /usr/include/c++/7/bits/std_function.h:316 #3 0x55d31c2389cc in std::function<void ()>::operator()() const /usr/include/c++/7/bits/std_function.h:706 #4 0x55d31c22795b in runTests(int) /in/compile/TestFunctions.cpp:19 #5 0x55d31c224800 in main /in/compile/test.cpp:13 #6 0x7f8f3326dc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) #7 0x55d31c224559 in _start (/out/package/test+0x1b559) 0x60200000000c is located 4 bytes to the left of 4-byte region [0x602000000010,0x602000000014) allocat
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 1, which should be 0.
Please double check your code to solve this problem and try again.
Your Answer
Test 26: Empty Tree Empty? Yes Sum: 0 Depth: 0
JOJ Answer
Test 26: Empty Tree Empty? Yes Sum: 0 Depth: 0 In-order Traversal: