Skip to content

Instantly share code, notes, and snippets.

View Ankit-Pankaj's full-sized avatar
🎯
Focusing

Ankit-Pankaj

🎯
Focusing
View GitHub Profile
@Ankit-Pankaj
Ankit-Pankaj / Detect Cycle in Directed graph.cpp
Last active March 16, 2021 11:52
#cycle #detect #graph
// { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define watch2(x,y) cout <<(#x)<<" is "<<(x)<<" and "<<(#y)<<" is "<<(y)<<"\n"
//--------------------------------------------------------------------------------------------------
// Detect cycle in Directed Graph
// https://www.youtube.com/watch?v=1u2VLzBhJZU
bool res=true;