Stokastik

Machine Learning, AI and Programming

Tag: Directed Graph

Leetcode : Redundant Connections 2

Problem Statement Solution: The brute force approach for this problem would be to do a DFS or BFS starting from each node after removing edge Ei in the input 'edges' array. At each position i from right to left, after removing Ei, do BFS from each node in the graph. If for BFS from any node, we cover all the nodes from 1 to N without any cycle, then return […]

Continue Reading →