MCPcopy Create free account
hub / github.com/BowenFu/matchit.cpp / main

Function main

sample/Red-black-Tree-Rebalancing.cpp:134–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132#endif
133
134int main()
135{
136 auto x = std::make_shared<Node<int>>(Color::Red, std::shared_ptr<Node<int>>{},
137 1, std::shared_ptr<Node<int>>{});
138 auto y = std::make_shared<Node<int>>(Color::Red, std::shared_ptr<Node<int>>{},
139 2, x);
140 auto z = std::make_shared<Node<int>>(Color::Black,
141 std::shared_ptr<Node<int>>{}, 3, y);
142 std::cout << "before balance: " << z->value << std::endl;
143 z->balance();
144 std::cout << "after balance: " << z->value << std::endl;
145 return 0;
146}

Callers

nothing calls this directly

Calls 1

balanceMethod · 0.80

Tested by

no test coverage detected