Back to Browse

Graph -13: Check if Directed Graph has Cycle (Using DFS)

9.9K views
May 2, 2020
26:03

Source Code:https://thecodingsimplified.com/check-if-directed-graph-has-cycle-using-dfs/ Solution: - We'll achieve this via dfs (depth first search) - With visited array, we'll also take recursiveStack array - Whenever we visit the array, we mark the value True in visited Array - If value is already in recursive stack, then we've cycle here. - Else we put the the value true in recursiveStack array - If we could not find cycle then we set value false in recursiveStack CHECK OUT CODING SIMPLIFIED https://www.youtube.com/codingsimplified ★☆★ VIEW THE BLOG POST: ★☆★ http://thecodingsimplified.com I started my YouTube channel, Coding Simplified, during Dec of 2015. Since then, I've published over 400+ videos. ★☆★ SUBSCRIBE TO ME ON YOUTUBE: ★☆★ https://www.youtube.com/codingsimplified?sub_confirmation=1 ★☆★ Send us mail at: ★☆★ Email: [email protected]

Download

1 formats

Video Formats

360pmp433.8 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Graph -13: Check if Directed Graph has Cycle (Using DFS) | NatokHD