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
What do you mean aidl?
What are validation rules?
What is partial selectors?
pl. give me the list of top jobs website to register i have 2Yrs. Experience in manual testing
please tell me answer of these qs. what is pure botany? what is applied botany? i face these Qs in commission exam plz plz help me.
Please answer me for the followings 1. i taken an office on January @ rent 28000.00 for one year and i paid 14000.00 as first payment balance will be paid on august. in tally how we post this and under which account especially balance 14000.0 under which account. 2.i have taken a loan from mr. A the amount is 100000.00 on January and the interest i need to pay on march 21000.00 the interest which iam going to pay is liability not a expense and it will be a expense in future, how we can post this also in tally and under which account. please somebody guide me who knows regards niyas es
What is font style in excel?
What is the Problem in Testing Antibiotic Sensitivity of Clumping Bacteria?
What are end points, contract, address and bindings?
which two sets the x position of the instance my_mc to that of the mouse cursor? : Adobe flash
How data flow happens in sap fiori launchpad? Explain the steps?
What are the two basic modes in which the 555 timer operates?
What is the use of jdbc?
How does the approach fit with the enterprise architecture?