Re: [Tutor] tree or link-list questions.

2019-06-26 Thread Alan Gauld via Tutor
On 26/06/2019 11:34, mhysnm1...@gmail.com wrote: > The reason why I am using the tree structure like a file system. Is I am > going to attempt to write some code to walk down the tree based upon certain > conditions which I am still working on. Based upon the test conditions will > determine how I

Re: [Tutor] tree or link-list questions.

2019-06-26 Thread mhysnm1964
because I am learning. I am pushing myself beyond my normal level of skills. Playing in the dark as I say. LOL Sean -Original Message- From: Tutor On Behalf Of Alan Gauld via Tutor Sent: Wednesday, 26 June 2019 2:48 AM To: tutor@python.org Subject: Re: [Tutor] tree or link-list questions

Re: [Tutor] tree or link-list questions.

2019-06-25 Thread Alan Gauld via Tutor
On 25/06/2019 13:24, mhysnm1...@gmail.com wrote: ... the tree I am trying to create is: > > * A single root node > * A node can only have a single parent. > * A parent can have multiple children. > * Each node is unique. A tree with multiple children (where multiple is more than 2

Re: [Tutor] tree or link-list questions.

2019-06-25 Thread Alan Gauld via Tutor
On 25/06/2019 13:24, mhysnm1...@gmail.com wrote: A much less open ended question :-) > class Node: > > def __init__(self, name, value): > self.parent = None > self.child = [] This should be plural if its a list. So call it children... However I'm not really sure it should b

[Tutor] tree or link-list questions.

2019-06-25 Thread mhysnm1964
All, Windows 10, python 3.6. I am trying to create a data structure. I might be using the wrong term here, but I am calling it a hierarchical tree. The properties of the tree I am trying to create is: * A single root node * A node can only have a single parent. * A pare