Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #30063

Re: Forming tree from parent set

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Forming tree from parent set
Date 2014-10-06 08:02 -0400
Organization A noiseless patient Spider
Message-ID <m0u0bu$e9$1@dont-email.me> (permalink)
References <77607811-7abb-4981-8f40-b46f6757d3d7@googlegroups.com>

Show all headers | View raw


On 10/6/2014 6:01 AM, Neel Salpe wrote:
> Form Tree from following data
>
> I have data like this
>
> 6 has parent SET 5,4
>
> 5 has parent SET 3,4,1,2
>
> 4 has parent SET 2,1,4
>
> 3 has parent SET 2,1
>
> I need to create tree like
>
> 1 --> 2 --> 3 --> 4 --> 5 --> 6
>
> OR
>
> 2--> 1--> 3--> 4-- >5 --> 6
>
> Because there is no enough info about 1-->2 or 2--> 1

     If it weren't for the circularity (4 being its own parent),
I'd say what you're looking for is "Topological Sorting."  That's
what to search for if 4's confused parentage is a typo; if it's
not, please explain more clearly what you're trying to do.

-- 
esosman@comcast-dot-net.invalid

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Forming tree from parent set Neel Salpe <itnilesh@gmail.com> - 2014-10-06 03:01 -0700
  Re: Forming tree from parent set Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-10-06 08:02 -0400
  Re: Forming tree from parent set Brixomatic <brixomatic@yahoo.com> - 2014-10-10 16:32 +0200

csiph-web