Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/core/RedBlackTree/RedBlackTree.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ const std::string RedBlackTree<T>::EMPTY_TREE_MESSAGE = "Empty Tree";

template <Comparable T>
RedBlackTree<T>::RedBlackTree() noexcept
: NIL(new Node(T(), NodeColor::Black, nullptr, nullptr, nullptr)),
root(NIL),
size(0)
{
NIL = new Node(T(), NodeColor::Black, nullptr, nullptr, nullptr);
NIL->left = NIL->right = NIL->parent = NIL;

root = NIL;
size = 0;
}

template <Comparable T>
Expand All @@ -29,10 +28,12 @@ RedBlackTree<T>::~RedBlackTree() noexcept

template <Comparable T>
RedBlackTree<T>::RedBlackTree(const RedBlackTree &other)
: NIL(new Node(T(), NodeColor::Black, nullptr, nullptr, nullptr)),
root(nullptr),
size(other.size)
{
NIL = new Node(T(), NodeColor::Black, nullptr, nullptr, nullptr);
NIL->left = NIL->right = NIL->parent = NIL;
root = copySubtree(other.root, nullptr);
size = other.size;
}

template <Comparable T>
Expand Down
3 changes: 0 additions & 3 deletions tests/UnitTests/BSTUnitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
/**
* @brief Tests for BinarySearchTree class.
*
* @todo
* 1. Refactor this test to implement C++ 23;
*
* @test
*
*/
Expand Down
4 changes: 0 additions & 4 deletions tests/UnitTests/RBTUnitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
/**
* @brief Tests for RedBlackTree class.
*
* @todo
* 1. Create tests for checking the internal structure of the tree;
* 2. Refactor this test to implement C++ 23;
*
* @test
*/
class RBTUnitTest : public testing::Test
Expand Down
Loading