It is implemented in recursion with LIFO stack data structure. It creates the same set of nodes as Breadth-First method, only in the different order.
As the nodes on the single path are stored in each iteration from root to leaf node, the space requirement to store nodes is linear. With branching factor b and depth as m, the storage space is bm.
Disadvantage: This algorithm may not terminate and go on infinitely on one path. The solution to this issue is to choose a cut-off depth. If the ideal cut-off is d, and if chosen cutoff is lesser than d, then this algorithm may fail. If chosen cut-off is more than d, then execution time increases.
Its complexity depends on the number of paths. It cannot check duplicate nodes.
Latest posts by FreelancingGig (see all)
- Why Do So Many Students Become Freelancers? - November 22, 2023
- Streamlining Business Processes: 4 Tech and Online Tips Entrepreneurs Should Follow for 2024 - November 21, 2023
- Driving ROI: Process Mining’s Role in Fleet Performance Improvement - November 16, 2023