Computer Science, asked by dwivedishruti3595, 1 year ago

Check if two binary search trees are identical given their array representations

Answers

Answered by Anonymous
0

Two arrays represent the same BST if, for every element x, the elements in left and right subtrees of x appear after it in both arrays. And same is true for roots of left and right subtrees. The idea is to check of if next smaller and greater elements are same in both arrays.

Similar questions