problemscpp
A collection of my answers to algorithm problems in c++.
载入中...
搜索中...
未找到
leetcode::number_of_ways_to_reconstruct_a_tree 命名空间参考

LeetCode 1719. Number Of Ways To Reconstruct A Tree 更多...

class  Solution
 

函数

 TEST (number_of_ways_to_reconstruct_a_tree, case1)
 
 TEST (number_of_ways_to_reconstruct_a_tree, case2)
 
 TEST (number_of_ways_to_reconstruct_a_tree, case3)
 

详细描述

LeetCode 1719. Number Of Ways To Reconstruct A Tree

函数说明

◆ TEST() [1/3]

leetcode::number_of_ways_to_reconstruct_a_tree::TEST ( number_of_ways_to_reconstruct_a_tree ,
case1  )

在文件 leetcode_test.cpp1552 行定义.

1552 {
1553 vector<vector<int>> input = {{1, 2}, {2, 3}};
1554 ASSERT_EQ(1, Solution::checkWays(input));
1555 }
static int checkWays(vector< vector< int > > &pairs)

引用了 leetcode::number_of_ways_to_reconstruct_a_tree::Solution::checkWays().

◆ TEST() [2/3]

leetcode::number_of_ways_to_reconstruct_a_tree::TEST ( number_of_ways_to_reconstruct_a_tree ,
case2  )

在文件 leetcode_test.cpp1557 行定义.

1557 {
1558 vector<vector<int>> input = {{1, 2}, {2, 3}, {1, 3}};
1559 ASSERT_EQ(2, Solution::checkWays(input));
1560 }

引用了 leetcode::number_of_ways_to_reconstruct_a_tree::Solution::checkWays().

◆ TEST() [3/3]

leetcode::number_of_ways_to_reconstruct_a_tree::TEST ( number_of_ways_to_reconstruct_a_tree ,
case3  )

在文件 leetcode_test.cpp1562 行定义.

1562 {
1563 vector<vector<int>> input = {{1, 2}, {2, 3}, {2, 4}, {1, 5}};
1564 ASSERT_EQ(0, Solution::checkWays(input));
1565 }

引用了 leetcode::number_of_ways_to_reconstruct_a_tree::Solution::checkWays().