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)
- Brand strategy: secrets that are not shared - February 2, 2024
- Crafting Visual Narratives: The Role of Motion Graphic Design in Digital Storytelling - January 23, 2024
- Unleashing Insights: Navigating the World of Data Science for Informed Decision-Making - January 23, 2024