You have given 2 array. You need to find whether they will
create the same BST or not.
For example:
Array1:10 5 20 15 30
Array2:10 20 15 30 5
Result: True
Array1:10 5 20 15 30
Array2:10 15 20 30 5
Result: False
One Approach is Pretty Clear by creating BST O(nlogn) then
checking two tree for identical O(N) overall O(nlogn) ..we
need there exist O(N) Time & O(1) Space also without extra
space .Algorithm ??
DevoCoder
guest
Posted 3 months ago #
#define true 1
#define false 0
int check(int a1[],int a2[],int n1,int n2)
{
int i;
//n1 size of array a1[] and n2 size of a2[]
if(n1!=n2) return false;
//n1 and n2 must be same
for(i=0;i
23. What is SBC
differences between poco, model first and data first approach?
What is meant by annotation in hibernate?
why does drupal need a database?
How to download xcode for iphone development?
How it is different from gsm?
What web sites do you feel use javascript most effectively (i.e., Best-in-class examples)? The worst?
How to fill element (initialize at once) in an array?
13. How many TRX are supported when we use one M2HA card in BTS? 14. Name the different types of power supply card in BTS and the output power of each card
hello sir iam atul joshi from mechanical branch. i want to know about the syllabus of technical ques of jindal steel
Compare RDBMS with Hadoop MapReduce.
What are the different new form element types in html 5?
What do you mean by a service fabric in azure?
Which is better php or wordpress?