Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'yet.': 0.04; 'root': 0.05; 'tree': 0.05; 'binary': 0.07; 'nested': 0.07; 'library?': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '2],': 0.16; 'node.': 0.16; 'subject:library': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; '>': 0.26; 'this:': 0.26; 'header:In-Reply- To:1': 0.27; 'tried': 0.27; "doesn't": 0.30; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'lists?': 0.31; 'url:python': 0.33; 'received:google.com': 0.35; 'there': 0.35; 'url:listinfo': 0.36; 'url:org': 0.36; 'clear': 0.37; 'represent': 0.38; 'pm,': 0.38; '12,': 0.39; 'url:mail': 0.40; 'easy': 0.60; 'such': 0.63; 'more': 0.64; '3-4': 0.68; 'joel': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=n50iMaRM7gW5JOj2Gmh6OocnDDZwtbz2p7uVvnTtuGc=; b=WCTvQCeBJzmYBZjHjycoh9v5cDd7Amk5sca4WlhAd3A9EPzL3hqHIzXFRPkmfX7OHR RtP+X4c3CD+bQYPRSU267x+O4X3CI8ORyzpPqcJ838cC7YLgOmDIv/mzudwDvefBgf76 IHoByf9E2RXTCkguUy7ctj3BRiUnal5Au48wUQGMffjeJMzbLAgN4JY3xznUiOMuBMu5 06yqUW21RK8IsJMFK3ul93Vve0UaoT0izaglkC9YvneNlCPp0B4Smy9jdqmEtlucBU7y Tf68QtgY5d2dYTFvWrmx+Iagf3BmIjqmSOKogojkH+JT2+psNJhwACNBnof4diDsHYnF fRCg== MIME-Version: 1.0 X-Received: by 10.220.19.134 with SMTP id a6mr713581vcb.36.1386876611650; Thu, 12 Dec 2013 11:30:11 -0800 (PST) In-Reply-To: References: <52A9FD0A.9080804@gmail.com> Date: Thu, 12 Dec 2013 14:30:11 -0500 Subject: Re: Tree library - multiple children From: Joel Goldstick To: Neil Cerutti Content-Type: multipart/alternative; boundary=001a11c3ae1cc9314b04ed5b5f80 Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 89 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386876619 news.xs4all.nl 2847 [2001:888:2000:d::a6]:51870 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61744 --001a11c3ae1cc9314b04ed5b5f80 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Dec 12, 2013 at 2:26 PM, Neil Cerutti wrote: > On 2013-12-12, Ricardo Ar=C3=A1oz wrote: > > I need to use a tree structure. Is there a good and known library? > > Doesn't have to be binary tree, I need to have multiple children per > node. > > Have you tried nested lists? > > [[1, 2], [3, 4] > I think that was a type for this: [[1, 2], [3, 4]] > > Can represent > > root > / \ > 1-2 3-4 > > Python makes it very easy to manipulate such a structure. It > isn't clear that you need more than that yet. > > -- > Neil Cerutti > > -- > https://mail.python.org/mailman/listinfo/python-list > --=20 Joel Goldstick http://joelgoldstick.com --001a11c3ae1cc9314b04ed5b5f80 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



On Thu, Dec 12, 2013 at 2:26 PM, Neil Cerutti <= ;neilc@norwich.edu> wrote:
On 2013= -12-12, Ricardo Ar=C3=A1oz <ricara= oz@gmail.com> wrote:
> I need to use a tree structure. Is there a good and known library?
> Doesn't have to be binary tree, I need to have multiple children p= er node.

Have you tried nested lists?

[[1, 2], [3, 4]

I think that was a type= for this:

[[1, 2], [3, 4]]
=C2=A0

Can represent

=C2=A0 =C2=A0 =C2=A0root
=C2=A0 =C2=A0 =C2=A0/ =C2=A0\
=C2=A0 1-2 =C2=A0 =C2=A03-4

Python makes it very easy to manipulate such a structure. It
isn't clear that you need more than that yet.

--
Neil Cerutti

--
https://mail.python.org/mailman/listinfo/python-list



--
--001a11c3ae1cc9314b04ed5b5f80--