Tree

public class Tree<E>

A Tree data type with a value of some type E and children subtrees.

  • Declaration

    Swift

    public var value: E
  • Declaration

    Swift

    public var children: [Tree<E>]
  • Declaration

    Swift

    public weak var parent: Tree<E>?
  • Declaration

    Swift

    public init(value: E)
  • Add a child to the tree’s children and set a weak reference from the child to the parent (self)

    Declaration

    Swift

    public func addChild(settingParentOf child: Tree)