Ternary Search Tree implementation in C