the_dawn 0 Newbie Poster

Am a newbie at LISP and trying to search through a tree using the BFS and DFS and got this far and am not sure if what i did sets the goal node to "n" because its supposed to start from a to the goal node and return the path....cant seem to get it to return the path at all.
1)generating the tree
(setf tree '((a) (b c) (d e f g) (i h j k l m n)))
2)the DFS function
(defun depth-first (start goal-n successors)
"search new states until goal is reached."
(tree-search (list start goal-n successors #* append)))
3)the BFS function
(defun breath-first (start goal-n successors)
"search new states until goal is reached."
(tree-search (list start goal-n successors #* prepend)))

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.