Update heavy_light_decomposition.cpp

This commit is contained in:
Aniruthan R
2020-08-14 01:22:55 +05:30
committed by GitHub
parent 331c52213d
commit c6ecbb6bd2

View File

@@ -452,7 +452,9 @@ public:
*/ */
void test_1() { void test_1() {
std::cout << "Test 1:\n"; std::cout << "Test 1:\n";
/* Test details */ /**
* Test details
*/
int n = 5; int n = 5;
std::vector<int64_t> node_values = {4, 2, 5, 2, 1}; std::vector<int64_t> node_values = {4, 2, 5, 2, 1};
std::vector<std::vector<int>> edges = { std::vector<std::vector<int>> edges = {
@@ -466,7 +468,7 @@ void test_1() {
{1, 3, 2}, {1, 3, 2},
{2, 4}, {2, 4},
}; };
/* ------------ */
HLD<int64_t> hld(n); HLD<int64_t> hld(n);
hld.set_node_val(node_values); hld.set_node_val(node_values);
for(int i = 0; i < n - 1; i++) { for(int i = 0; i < n - 1; i++) {
@@ -492,7 +494,9 @@ void test_1() {
void test_2() { void test_2() {
std::cout << "Test 2:\n"; std::cout << "Test 2:\n";
/* Test details (Bamboo) */ /**
* Test details (Bamboo)
*/
int n = 10; int n = 10;
std::vector<int64_t> node_values = {1, 8, 6, 8, 6, 2, 9, 2, 3, 2}; std::vector<int64_t> node_values = {1, 8, 6, 8, 6, 2, 9, 2, 3, 2};
std::vector<std::vector<int>> edges = { std::vector<std::vector<int>> edges = {
@@ -518,7 +522,7 @@ void test_2() {
{1, 1, 4}, {1, 1, 4},
{1, 2, 7} {1, 2, 7}
}; };
/* ------------ */
HLD<int64_t> hld(n); HLD<int64_t> hld(n);
hld.set_node_val(node_values); hld.set_node_val(node_values);
for(int i = 0; i < n - 1; i++) { for(int i = 0; i < n - 1; i++) {