Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TNode ¶
type TNode struct { // The value of the node. Val interface{} // contains filtered or unexported fields }
Tree node in a cross doubly linked list structure.
func (*TNode) AppendTo ¶
AppendTo appends the node to the specified new parent as the last child. It will be removed from the children of the original parent node, if exists.
[PARAMETERS]
parent *TNode // The new parent. If this is nil, it will make the node parentless.
[RETURNS]
bool // If the operation succeeds, it is true, otherwise it means that the node is nil.
func (*TNode) Children ¶
Children returns a list of all children of the node. A nil value means that it does not have any child.
func (*TNode) FirstChild ¶
FirstChild returns the first child of the node. A nil value means that it does not exist.
func (*TNode) LastChild ¶
LastChild returns the last child of the node. A nil value means that it does not exist.
func (*TNode) Next ¶
Next returns the next sibling of the node. A nil value means that it does not exist.
type Tree ¶
type Tree = *TNode
Points to the root of which tree it represents.