Given two arrays which would be used to construct two different binary search trees(BSTs), write a prgram to identify if the BSTs constructed from these would be identical. The condition is that the program should be able to identify this without actually building BSTs.

For example, using array {3,5,4,6,1,0,2} the BST constructed would be -

You can verify that using array {3,1,5,2,4,6,0} the same BST would be constructed.

In the following example though, the BST constructed using array {6,9,8} is not same as the BST constructed using array {6,8,9}.