ishu9bansal / ideone

useful pieces of codes
1 stars 1 forks source link

Union finding algorithm #12

Open ishu9bansal opened 4 years ago

ishu9bansal commented 4 years ago

https://leetcode.com/submissions/detail/388808430/?from=/explore/featured/card/august-leetcoding-challenge/553/week-5-august-29th-august-31st/3442/

ishu9bansal commented 2 years ago

motivated by votrubac's code here: https://leetcode.com/problems/shortest-bridge/discuss/189293/C%2B%2B-BFS-Island-Expansion-%2B-UF-Bonus

make changes to convert it to recursive approach instead https://github.com/ishu9bansal/ideone/tree/master/union_graph