Depth Fist Search and Breadth First Search and using array
- From: Summercool <Summercoolness@xxxxxxxxx>
- Date: Sun, 30 Sep 2007 01:22:07 -0000
I just wonder if for DFS (Depth Fist Search), we don't really need an
array to act as a Stack (LIFO), but we can just use recursion.
Is it true that the main concern is stack overflow? (if too deep
level). If we use the array as a stack, then the overflow problem is
gone. Now, however, if our program is to spider the web, or to go
down the game tree, and we set the levelMax to 10, then the stack
overflow problem is really not there, as the deepest call stack level
is 10.
Is it true that for BFS (Breadth First Search), we always have to use
an array as a Queue (FIFO)? Using an array seems a bit like a "global
variable". Is it possible at all to do BFS without using an array as
a queue and just use recursion?
.
- Follow-Ups:
- Re: Depth Fist Search and Breadth First Search and using array
- From: Logan Shaw
- Re: Depth Fist Search and Breadth First Search and using array
- Prev by Date: Re: 800 MB analyses
- Next by Date: whoever you hire, make sure it isn't a college graduate
- Previous by thread: 800 MB analyses
- Next by thread: Re: Depth Fist Search and Breadth First Search and using array
- Index(es):
Relevant Pages
|