Depth First search algorithm on Artificial Intelligence?
Here is the algorithm for depth first search on Artificial Intelligence...
and what i need is...can i have this algorithm written in C++ programming language...please help me out...!!!!!
Algorithm for Depth first search
function DFS (problem){
open = (C_0); //put initial state C_0 in the List
closed = {}; /maintain list of nodes examined earlier
while (not (empty (open))) {
f = remove_first(open);
if IsGoal (f) then return (f);
closed = append (closed, f);
l = not-in-set (Successors (f), closed );
open = merge ( rest(open), l); //prepend to the list
}
return ('fail')
}
PLZ PLZ PLZ SEND IT SOON...IT'S URGENT...!!!
Here is the algorithm for depth first search on Artificial Intelligence...
and what i need is...can i have this algorithm written in C++ programming language...please help me out...!!!!!
Algorithm for Depth first search
function DFS (problem){
open = (C_0); //put initial state C_0 in the List
closed = {}; /maintain list of nodes examined earlier
while (not (empty (open))) {
f = remove_first(open);
if IsGoal (f) then return (f);
closed = append (closed, f);
l = not-in-set (Successors (f), closed );
open = merge ( rest(open), l); //prepend to the list
}
return ('fail')
}
PLZ PLZ PLZ SEND IT SOON...IT'S URGENT...!!!