MathWorks Interview Question

Detect cycle in a graph