Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: perl question

by muba (Priest)
on Sep 09, 2011 at 12:50 UTC ( [id://925076]=note: print w/replies, xml ) Need Help??


in reply to perl question

Another issue that I haven't seen anyone else comment on yet, is that there's nothing to catch the situation where two nodes don't have a common ancestor — because if I understand what you're trying to do, it's that: find a common ancestor of any two nodes, am I right?

But is it absolutely true that all nodes always live in the same tree?

Addendum: trying to go over your code once again, I'm also struck by the, ehhh... weird... calling convention of getDistance. Normally, to get a distance between any two things, you need, well, any two things. Even in a question like, "how far is it to the supermarket?" what you're really asking is the distance between here and the supermarket. Yet, your getDistance sub is only called with one argument. I find that confusing.

Edit: fixed some bad typing.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-19 10:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found