Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Tree in perl

by LanX (Saint)
on Nov 17, 2014 at 21:10 UTC ( [id://1107478]=note: print w/replies, xml ) Need Help??


in reply to Re: Tree in perl
in thread Tree in perl

> without simple cycles is a tree.

Look at the data to discover the circle cycle :)

1 2; 2 3; 1 3

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

Replies are listed 'Best First'.
Re^3: Tree in perl
by Anonymous Monk on Nov 17, 2014 at 23:13 UTC
    This does not look as a cycle or a circle to me.

      This does not look as a cycle or a circle to me.

      Why not?

      1 2 2 3 1 3 DO YOU SEE IT NOW? [1,--2] | | | [2,3] | | [1,----3]
        To elaborate further ... One might dispute (or rather get confused) if the graph is directed or not¹, but in either case it's certainly not a tree.

        1 /| 2 | \| 3

        edit

        Furthermore asking for the "shortest" path in a tree doesn't make much sense, there is by definition exactly one between any two nodes.

        Cheers Rolf

        (addicted to the Perl Programming Language and ☆☆☆☆ :)

        ¹) the definition above circumvents the problem by postulating an undirected graph.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-23 06:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found