Insertion and deletion on trinary tree