19(March) Possible Paths in a Tree
19. Possible Paths in a Tree
Problem Description
n = 7
edges {start, end, weight} = {{1, 2, 3}, {2, 3, 1}, {2, 4, 9}, {3, 6, 7}, {3, 5, 8}, {5, 7, 4}}
q = 3
queries[] = {1, 3, 5}1 3 4My Approach
Time and Auxiliary Space Complexity
Code (C++)
Contribution and Support
📍Visitor Count
Previous18(March) Level order traversalNext20(March) Sum of nodes on the longest path from root to leaf node
Last updated