Yes, I know there is a simple detection algorithm using DFS, but assume for a certain application, I'm interesting in doing via breadth first search traversal, is it possible to do so? I've only seen confirmations about that on quora but without psuedo code or any details.
What is the most efficient way to do so? and if possible, can someone please supply a code? ( A simple short pseudo code is enough).
Thanks.