What are the disadvantages of Depth-First Search Algorithm?

  • As the algorithm may not terminate and go on infinitely on one path. Hence, a solution to this issue is to choose a cut-off depth.
  • If the ideal cut-off is d, and if the chosen cut-off is lesser than d, then this algorithm may fail.
  • If the chosen cut-off is more than d, then execution time increases.
  • Its complexity depends on the number of paths. It cannot check duplicate nodes.