Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node[T constraints.Ordered] struct { // contains filtered or unexported fields }
Node represents a binary search tree node of type T.
func NewNode ¶
func NewNode[T constraints.Ordered](value T) *Node[T]
NewNode creates a new binary search tree node with the given value of type T.
func (*Node[T]) InorderTraversal ¶
func (n *Node[T]) InorderTraversal()
InorderTraversal traverses the binary search tree in inorder fashion.
func (*Node[T]) PostorderTraversal ¶
func (n *Node[T]) PostorderTraversal()
PostorderTraversal traverses the binary search tree in postorder fashion.
func (*Node[T]) PreorderTraversal ¶
func (n *Node[T]) PreorderTraversal()
PreorderTraversal traverses the binary search tree in preorder fashion.
Click to show internal directories.
Click to hide internal directories.