Keep It Simple, Stupid | |
PerlMonks |
Re^5: How do I create a binary tree ?by punitpawar (Sexton) |
on Dec 21, 2015 at 19:56 UTC ( [id://1150881]=note: print w/replies, xml ) | Need Help?? |
Hello , How can I do a Breadth First search for a binary tree in perl ? For the above code how can I go ahead and create a subroutine for Breadth First search ? For a breadth first search , since I have to visit the left node first and then the right node and then repeat this process till I reach the very end , I fee its sort of tricky... I have written a snippet below for "Depth First" search , but not able to think for a Breadth first search
In Section
Seekers of Perl Wisdom
|
|