Skip to content

Commit

Permalink
fix:free memory for auto test case
Browse files Browse the repository at this point in the history
  • Loading branch information
liushubin-gitHub committed Jul 10, 2020
1 parent 49ccaa6 commit cf8917e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions data_structures/binary_search_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ void test_tree() {
assert(arr[i] != 2);
}
std::cout << "Test Remove(2) Passed\n========================\n";

// free memory
Remove(root, root, 1);
Remove(root, root, 3);
Remove(root, root, 6);
Remove(root, root, 5);
Remove(root, root, 7);
Remove(root, root, 4); // remove root node
}

/** main test function with commands.
Expand Down

0 comments on commit cf8917e

Please sign in to comment.