toString

open override fun toString(): String

Returns a string representation of the TreeNode.

The string includes the node's value and, if present, its children enclosed in curly braces and separated by commas.

Return

A string representation of the TreeNode.