ternary trees article