Solution (source code)

= Solution

Each <binary tree> entry stores its word, positive frequency, and two child references:
``
class Tree(val word: String, var count: Int,
           var left: Tree = null, var right: Tree = null)
``
A `null` reference denotes an empty <subtree>. A word is a non-null <string data type> value; its order below is the fixed lexicographic order used by `String.compareTo`.