Record Case Detail

Notes

This function is in beta test. Please help improve it in the issues here.

Stderr

=================================================================
==49143==ERROR: AddressSanitizer: heap-use-after-free on address 0x603000000048 at pc 0x559f886ea31c bp 0x7ffe76724720 sp 0x7ffe76724710
READ of size 8 at 0x603000000048 thread T0
    #0 0x559f886ea31b in BinaryTree::removeAll(TreeNode*) /in/ex6.cpp:19
    #1 0x559f886eade8 in BinaryTree::~BinaryTree() /in/ex6.cpp:58
    #2 0x559f886ec7f3 in test1() /in/compile/TestFunctions.cpp:91
    #3 0x559f886fcca2 in std::_Function_handler<void (), void (*)()>::_M_invoke(std::_Any_data const&) /usr/include/c++/7/bits/std_function.h:316
    #4 0x559f886fc97c in std::function<void ()>::operator()() const /usr/include/c++/7/bits/std_function.h:706
    #5 0x559f886ebaa3 in runTests(int) /in/compile/TestFunctions.cpp:19
    #6 0x559f886e9f10 in main /in/compile/test.cpp:13
    #7 0x7f1797feec86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
    #8 0x559f886e9c69 in _start (/out/package/test+0x19c69)

0x603000000048 is located 8 bytes inside of 

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 1: In-order Traversal: 5 10 15 

JOJ Answer

Test 1: In-order Traversal: 5 10 15