Create sametree, search 2D matrix and search insert position