Record Case Detail

Notes

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

Stderr

=================================================================
==53994==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new vs operator delete []) on 0x603000000010
    #0 0x7fbedcd27480 in operator delete[](void*) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe1480)
    #1 0x55c5dd72d171 in BinaryTree::~BinaryTree() /in/ex6.cpp:87
    #2 0x55c5dd73c9a0 in test28() /in/compile/TestFunctions.cpp:361
    #3 0x55c5dd73ec0e in std::_Function_handler<void (), void (*)()>::_M_invoke(std::_Any_data const&) /usr/include/c++/7/bits/std_function.h:316
    #4 0x55c5dd73e8e8 in std::function<void ()>::operator()() const /usr/include/c++/7/bits/std_function.h:706
    #5 0x55c5dd72d877 in runTests(int) /in/compile/TestFunctions.cpp:19
    #6 0x55c5dd72bf70 in main /in/compile/test.cpp:13
    #7 0x7fbedb5b4c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
    #8 0x55c5dd72bcc9 in _start (/out/package/test+0x19cc9)

0x603000000010 is located 0 bytes inside of 24-byte region [0x603000000010,0x6030000

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 28: Comparison of Empty and Single Node Tree
Empty Tree Empty? Yes
Single Node Tree Empty? No
Single Node Tree Sum: 0
Are trees equal? No

JOJ Answer

Test 28: Comparison of Empty and Single Node Tree
Empty Tree Empty? Yes
Single Node Tree Empty? No
Single Node Tree Sum: 1
Are trees equal? No