Intuit | SDE2
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2024-02-26Added By Anonymous
Source: Link
Given a maze of tunnels which are structured as a n-ary tree starting from a single entry point, find the minimum cost to visit all the tunnel paths at least once. There is a cost involved in walking through a tunnel. Each time you cross that tunnel, the cost is added.
1Minimum cost is 4
2A
3|_ A.1
4|_ A.2
5 |_ A.2.1
6
7Minimum cost is 19 for below tree
8A
9|_ B
10 |_ B.1
11 |_ B.2
12 |_ B.3
13|_ C
14 |_ C.1
15|_ D
16 |_ D.1
17 |_ D.2
18 |_ D.3
19 |_ D.3.1