Search   Feed   Browse   Add
Feed items 1 - 1 of 1 for September 2007

City Life

City Life

DFS With Explicit Stack - September 20, 2007

Recursive depth first search (DFS) is so trivial to write, it is easy to forget that in Java heap size is usually much greater than stack size, so it is always possible to have a graph that is too deep to traverse recursively. Easy, at least, until StackOverflowException knocks your application into the middle of next week.No problem, you say. I'll just rewrite the DFS using an explicit stack. Let's see, the algorithm I learned in school is something like:public void dfs(Vertex root) Stack s..
http://www.jroller.com/bobfoster/entry/depth_first_search_with_explicit
Available Archives
- January (1 item)
- February (1 item)
- March (2 items)
- April (4 items)
- May (2 items)
- July (1 item)
- September (1 item)
- October (1 item)
Sponsored Links
© 2008 FeedCapsule.com  |  Contact