The id parameter is of type BinaryTreeNodeId and represents the unique identifier
for the binary tree node.
Optional val: TThe val parameter is an optional parameter of type T. It represents the value of the binary
tree node. If no value is provided, it will be undefined.
Optional count: numberThe count parameter is an optional parameter that represents the number of times the
value val appears in the binary tree node. If the count parameter is not provided, it defaults to 1.
The function creates a new binary tree node with an optional value and count, and returns it as a specified type.
The id parameter is the identifier for the binary tree node. It is of type
BinaryTreeNodeId, which could be a string or a number depending on how you want to identify your nodes.
Optional val: TThe val parameter is an optional value that can be assigned to the node. It represents the
value stored in the node.
Optional count: numberThe count parameter is an optional parameter that represents the number of times the value appears in the binary tree node.
a new instance of the BinaryTreeNode class, casted as the FAMILY type.
The function swaps the location of two nodes in a binary tree.
The swapNode parameter is of type FAMILY, which represents a node in a family tree.
the swapNode object after swapping its properties with the properties of this object.
Generated using TypeDoc
The constructor function initializes a BinaryTreeNode object with an id, value, and count.