DEAPTH FIRSH SEARCH help
I need program of
DEAPTH FIRSH SEARCH
s ---------- level 0
/ \
a b -----------level 1
/ \ / c d e f ------------level 2
in the above tree s has two children 'a' and 'b' where as 'a' has again two children 'c' and 'd' . ' b' has two children 'e' and 'f', and the proceeds so on.
DEAPTH FIRSH SEARCH
in this we take one node and teh take its left child first, and to taht node its left child and so on. and if came to bottom then again we go at top and start from the node which is untouched
for the above tree Deapth first search is
sacdbef.
so if the goal is d then dfs is sacd
rAjU
|