Tri-nary Tree implementation