Timeline for Do you get DFS if you change the queue to a stack in a BFS implementation?
Current License: CC BY-SA 3.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 3, 2014 at 14:31 | history | tweeted | twitter.com/#!/StackCompSci/status/484705917737660416 | ||
Mar 14, 2012 at 9:49 | vote | accept | rgrig | ||
Mar 14, 2012 at 8:23 | comment | added | Joe |
It is possible to write pseudo-code so that simply by changing pop to a stack or a queue operation, we get dfs or bfs. It's also easy to write pseudo-code for which it at first appears that this is true, but it isn't. ics.uci.edu//~eppstein/161/960215.html is a relevant reference.
|
|
Mar 13, 2012 at 22:40 | answer | added | Aryabhata | timeline score: 27 | |
Mar 13, 2012 at 22:26 | comment | added | Gilles 'SO- stop being evil' | @Joe, Dave: please see the ensuing meta discussion | |
Mar 13, 2012 at 20:44 | history | edited | rgrig | CC BY-SA 3.0 |
added 135 characters in body
|
Mar 13, 2012 at 18:34 | comment | added | rgrig | "Yes" would come with a convincing argument; "no" would come with a counterexample. But there are better answers than yes/no once you understand what's going on... | |
Mar 13, 2012 at 18:32 | history | edited | rgrig | CC BY-SA 3.0 |
deleted 1 characters in body
|
Mar 13, 2012 at 18:31 | history | edited | Raphael |
edited tags
|
|
Mar 13, 2012 at 18:30 | comment | added | Raphael | I have seen students struggle with this, so I don't think it is strictly too simple. However, what more than "Yes" or "No" should an answer contain? The desired granularity is not clear from the question. | |
Mar 13, 2012 at 18:08 | history | edited | rgrig | CC BY-SA 3.0 |
arghh
|
Mar 13, 2012 at 18:03 | history | asked | rgrig | CC BY-SA 3.0 |