Breadth-First
Searching
a Labeled Tree
lfindInTreeBF(P, T) =
findInForest(P, [T]);
lfindInForest(P, [ ])
=> [ ];
l findInForest(P, [Tree | Trees])
=>
Root = root(Tree),
foundInRest
= findInForest(P, append(Trees, getOffspring(Tree))),
P(Root)
? [Root | foundInRest] : foundInRest;

forest of
one tree