Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'yet.': 0.04; 'root': 0.05; 'tree': 0.05; 'binary': 0.07; 'nested': 0.07; 'library?': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; '2],': 0.16; 'node.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:library': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'header:X-Complaints- To:1': 0.27; 'tried': 0.27; "doesn't": 0.30; 'lists?': 0.31; 'there': 0.35; 'clear': 0.37; 'represent': 0.38; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'easy': 0.60; 'such': 0.63; 'more': 0.64; '3-4': 0.68 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Neil Cerutti Subject: Re: Tree library - multiple children Date: Thu, 12 Dec 2013 19:26:57 +0000 (UTC) Organization: Norwich University References: <52A9FD0A.9080804@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: jackman.norwich.edu User-Agent: slrn/0.9.9p1/mm/ao (Win32) 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386876443 news.xs4all.nl 2976 [2001:888:2000:d::a6]:49266 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61743 On 2013-12-12, Ricardo Aráoz 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] 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