Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Mark Jason Dominus And Me - The Partition Problem

by tilly (Archbishop)
on Nov 14, 2012 at 02:43 UTC ( #1003733=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Mark Jason Dominus And Me - The Partition Problem
in thread Mark Jason Dominus And Me - The Partition Problem

Indeed. People who only know how to traverse a directory using recursion will suffer grief if they are asked to do it breadth-first instead. Recursion gives you an implicit stack. If you can unwind it to get an explicit stack instead, then switching between depth-first and breadth-first is as simple as switching from a stack to a queue.

But, one step at a time. Recursion is a great technique for thinking through a problem that you don't know how solve up front. Once you understand that solution, you can start trying to think of other approaches with other trade-offs. :-)


Comment on Re^4: Mark Jason Dominus And Me - The Partition Problem

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003733]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2014-07-10 05:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (199 votes), past polls