Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==50017==ERROR: AddressSanitizer: heap-use-after-free on address 0x603000000048 at pc 0x55a5d86973ea bp 0x7ffed600d7c0 sp 0x7ffed600d7b0 READ of size 8 at 0x603000000048 thread T0 #0 0x55a5d86973e9 in in_order_traversal_helper /in/ex6.cpp:115 #1 0x55a5d86973f9 in in_order_traversal_helper /in/ex6.cpp:115 #2 0x55a5d86973f9 in in_order_traversal_helper /in/ex6.cpp:115 #3 0x55a5d86975e6 in BinaryTree::inOrderTraversal() const /in/ex6.cpp:122 #4 0x55a5d8699ab1 in test4() /in/compile/TestFunctions.cpp:114 #5 0x55a5d86a8ca2 in std::_Function_handler<void (), void (*)()>::_M_invoke(std::_Any_data const&) /usr/include/c++/7/bits/std_function.h:316 #6 0x55a5d86a897c in std::function<void ()>::operator()() const /usr/include/c++/7/bits/std_function.h:706 #7 0x55a5d8697aa3 in runTests(int) /in/compile/TestFunctions.cpp:19 #8 0x55a5d8695f10 in main /in/compile/test.cpp:13 #9 0x7fbd9bd46c86 in __libc_start_main (/lib/
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
JOJ Answer
Test 4: In-order Traversal: 10 20 25 30 35 50 60