trinary tree insert and delete