createCodeTree function
Passed encode and decode identity test