pairs to tree

Discussion in 'Perl Misc' started by George Mpouras, Apr 4, 2012.

  1. I am re-thinking an old graph problem . Any idea of how to build e.g. the
    tree

    a
    b
    e
    f
    c
    d
    t
    t
    a
    f
    a

    from the pairs ?

    f,a
    t,a
    d,t
    b,e
    b,f
    a,c
    a,d
    a,b
     
    George Mpouras, Apr 4, 2012
    #1
    1. Advertising

  2. George Mpouras

    Tim McDaniel Guest

    In article <jlho10$49i$>,
    George Mpouras <> wrote:
    >I am re-thinking an old graph problem . Any idea of how to build
    >e.g. the tree
    >
    >a
    > b
    > e
    > f
    > c
    > d
    > t
    >t
    > a
    >f
    > a
    >
    >from the pairs ?
    >
    >f,a
    >t,a
    >d,t
    >b,e
    >b,f
    >a,c
    >a,d
    >a,b


    I'm curious: for what class is this a homework problem?

    Also, I don't see the specification. The pairs are
    parent,child
    and it even appears to be bottom-up.

    But sometimes it's shown as transitive, like how
    b,e
    a,b
    resulted in
    a
    b
    e

    But
    t,a
    d,t
    does not result in
    d
    t
    a
    but instead
    t
    a
    is itself a side tree.

    --
    Tim McDaniel,
     
    Tim McDaniel, Apr 4, 2012
    #2
    1. Advertising

  3. order is not important. pairs are unique. it is about building topology maps.
     
    George Mpouras, Apr 4, 2012
    #3
  4. George Mpouras

    Tim McDaniel Guest

    In article <jlhrbs$p5o$>,
    Tim McDaniel <> wrote:
    >In article <jlho10$49i$>,
    >George Mpouras <> wrote:
    >>I am re-thinking an old graph problem . Any idea of how to build
    >>e.g. the tree
    >>
    >>a
    >> b
    >> e
    >> f
    >> c
    >> d
    >> t
    >>t
    >> a
    >>f
    >> a
    >>
    >>from the pairs ?
    >>
    >>f,a
    >>t,a
    >>d,t
    >>b,e
    >>b,f
    >>a,c
    >>a,d
    >>a,b

    >
    >I'm curious: for what class is this a homework problem?
    >
    >Also, I don't see the specification. The pairs are
    > parent,child
    >and it even appears to be bottom-up.
    >
    >But sometimes it's shown as transitive, like how
    > b,e
    > a,b
    >resulted in
    >a
    > b
    > e
    >
    >But
    > t,a
    > d,t
    >does not result in
    > d
    > t
    > a
    >but instead
    >t
    > a
    >is itself a side tree.



    Reply:
    > order is not important. pairs are unique. it is about building
    > topology maps.


    I'm usually fond of trimming unneeded text, but for someone on a
    newsgroup, trimming ALL context and background is not so good.

    I'm sorry, but you did not answer my questions. Expanding a bit:

    But sometimes it's shown as transitive, like how
    b,e
    a,b
    results in
    a
    b
    e

    But
    t,a
    d,t
    a,d
    does not result in
    a
    d
    t
    a
    but instead
    a
    d
    and
    t
    a
    in two separate trees. Why? How is the program supposed to know what
    to do?

    --
    Tim McDaniel,
     
    Tim McDaniel, Apr 5, 2012
    #4
  5. George Mpouras

    Marc Girod Guest

    On Apr 4, 8:25 pm, "George Mpouras"
    <> wrote:
    > order is not important. pairs are unique. it is about building topology maps.


    I have the same problem as Tim to understand your question.
    There are even cycles...

    t -> a -> d -> t
    f -> a -> b -> f

    Marc
     
    Marc Girod, Apr 11, 2012
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ramkumar Menon

    B+ Tree versus Ternary Search Tree

    Ramkumar Menon, Aug 16, 2005, in forum: Java
    Replies:
    2
    Views:
    1,647
    Roedy Green
    Aug 16, 2005
  2. Ramkumar Menon

    B+ Tree versus Ternary Search Tree

    Ramkumar Menon, Aug 16, 2005, in forum: Java
    Replies:
    0
    Views:
    474
    Ramkumar Menon
    Aug 16, 2005
  3. Ramkumar Menon

    B+ Tree versus Ternary Search Tree

    Ramkumar Menon, Aug 16, 2005, in forum: Java
    Replies:
    1
    Views:
    476
    Andrew Thompson
    Aug 16, 2005
  4. Joris Gillis
    Replies:
    2
    Views:
    1,568
    Joris Gillis
    Jun 16, 2006
  5. Stub

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,235
Loading...

Share This Page