implemented TernaryNode
implemented TernaryTree