Represents a simple tree.
Created on 6 Mar 2014
@author: paulross
Represents a set of parent/child relationships (and their inverse) as Adjacency Lists.
Returns an unordered list of objects that have at least one parent.
Returns an unordered list of objects that have at least one child.
Returns all immediate children of a given parent.
Returns True if the given child has any parents.
Returns True if the given parent has any children.
Returns all immediate parents of a given child.
Returns a Tree() object where the links are the relationships between child and parent. Cycles are not reproduced i.e. if a -> b and b -> c and c-> a then treeChildParent(‘a’) returns [‘a’, ‘c’, ‘b’,] treeChildParent(‘b’) returns [‘b’, ‘a’, ‘c’,] treeChildParent(‘c’) returns [‘c’, ‘b’, ‘a’,]
Returns a Tree() object where the links are the relationships between parent and child. Cycles are not reproduced i.e. if a -> b and b -> c and c-> a then treeParentChild(‘a’) returns [‘a’, ‘b’, ‘c’,] treeParentChild(‘b’) returns [‘b’, ‘c’, ‘a’,] treeParentChild(‘c’) returns [‘c’, ‘a’, ‘c’,]