Hacker News new | ask | show | jobs
by mbf1 1690 days ago
Recursion / Stacks are good for DFS traversals of a graph / tree. So maybe you could do a BFS traversal using a while loop and queue of nodes to process. I think that approach still doesn't save you any memory.