It is to my understanding when inserting a node to a binary search tree, the data element of the new node is compared to the data element of the node that will be the parent.

Now that I have a Ternary Search Tree with two data elements and three keys I am confused as to how I perform the insert. Please correct me if I am wrong. If both key1 and key2 of a Ternary Node are less than the key1 of the parent node, then I know I my node becomes a left child. If both key1 and key2 are greater than key1 of the parent node, but less than the key2 of the parent node, then my node becomes a middle child. And if both key1 and key2 are greater than key2 of the parent node, then my node becomes a right child.

My question is, what happens when key1 and key2 of my new node does not meet the previous conditions? For example what if key1 of the new node is less than key1 of the parent, and key2 of the new node is greater than key1 of the parent node, how will the insertion() be performed?