Google L3 | Interview

Anonymous User
2223
Oct 01, 2024
Oct 02, 2024

given a binary tree, with each edge having a cost associated. we want to cut the edges in such a way that all the leaf nodes get disconnected. find the min cost.
eg.
6
/ \
4 2
/
1
cost of 6-4 = 5, 6-2 = 1, 4-1 = 10 then ans should be 5 + 1 = 6

how to solve this?

Comments (12)