Tree class
Constructors
Section titled “Constructors”constructor
Section titled “constructor”⊕ new Tree(value?: T | T[] | Tree<T>): Tree
Parameters:
Section titled “Parameters:”- value:
T|T[] | Tree<T>, Default value =null
Public Properties
Section titled “Public Properties”childs
Section titled “childs”● childs: Tree<T>[] = []
parent
Section titled “parent”● parent: Tree<T> = null
● value: T = null
Public Methods
Section titled “Public Methods”addChild
Section titled “addChild”▸ addChild(child: Tree<T>): void
Parameters:
Section titled “Parameters:”- child: Tree<
T>
Returns void
contains
Section titled “contains”▸ contains(value: T): boolean
Parameters:
Section titled “Parameters:”- value:
T
Returns boolean
findNode
Section titled “findNode”▸ findNode(value: T): Tree<T> | null
Parameters:
Section titled “Parameters:”- value:
T
Returns Tree<T> | null
setParents
Section titled “setParents”▸ setParents(): void
Returns void