Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==52289==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000000c at pc 0x561be80dab47 bp 0x7ffe54853f20 sp 0x7ffe54853f10 READ of size 4 at 0x60200000000c thread T0 #0 0x561be80dab46 in BinaryTree::inOrderTraversal() const /in/ex6.cpp:123 #1 0x561be80e95ad in test26() /in/compile/TestFunctions.cpp:342 #2 0x561be80eca3a in std::_Function_handler<void (), void (*)()>::_M_invoke(std::_Any_data const&) /usr/include/c++/7/bits/std_function.h:316 #3 0x561be80ec714 in std::function<void ()>::operator()() const /usr/include/c++/7/bits/std_function.h:706 #4 0x561be80db83b in runTests(int) /in/compile/TestFunctions.cpp:19 #5 0x561be80d86e0 in main /in/compile/test.cpp:13 #6 0x7f25d10f2c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) #7 0x561be80d8439 in _start (/out/package/test+0x1b439) 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: