How to implement DFS without recursion and if there are many circular connections?

  • 0
    There is a two-dimensional array and a finite number of cells next to the same data value.
    need to bypass them
    JavaScript Anonymous, Jul 10, 2019

  • 2 Answers
  • 0
    Compile an "index" (like in books).
    Anonymous

  • 0
    If the recursion fails, then do not depth-first traversal, but breadth-first traversal (with a queue).
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!