Niiiice!!! One small remark. Boolean "onCurrentPath" instead of "beingVisited" would be more reflecting what's going on:) We have multiple being visited vertices in the path under exploring while function "hasCycle" at every moment works with only one vertex. It confuses. Even boolean "green" would be more self-telling:) 2. As I get your "stream branded" approach is not applicable here because of need to return value (boolean), is it? Thank you for the material🥳
Thanks, i've been searching for hours but only this did the trick, thank you so much
I feel like BFS is easier to find cycles.
Niiiice!!!
One small remark. Boolean "onCurrentPath" instead of "beingVisited" would be more reflecting what's going on:)
We have multiple being visited vertices in the path under exploring while function "hasCycle" at every moment works with only one vertex. It confuses. Even boolean "green" would be more self-telling:)
2. As I get your "stream branded" approach is not applicable here because of need to return value (boolean), is it?
Thank you for the material🥳
Glad I could help :) and 2-Yup.