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


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

Re: Forming tree from parent set

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Forming tree from parent set
Date Mon, 06 Oct 2014 08:02:01 -0400
Organization A noiseless patient Spider
Lines 30
Message-ID <m0u0bu$e9$1@dont-email.me> (permalink)
References <77607811-7abb-4981-8f40-b46f6757d3d7@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Mon, 6 Oct 2014 12:02:06 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="bd4e1cba8d8592bec5d5ed9e4537fbfd"; logging-data="457"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196u+/hiljqvttb0UIFCxSv"
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2
In-Reply-To <77607811-7abb-4981-8f40-b46f6757d3d7@googlegroups.com>
Cancel-Lock sha1:fdKQV9DEVZGxR3DS2fVshbi01WE=
Xref csiph.com comp.lang.java.programmer:30063

Show key headers only | 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