Post New Fitness First Everything Else AllOther Interview Questions
what is a bus post insulator? explain its application in a substation.
Why am I getting an ora-01000: maximum open cursors exceeded error, even though I closed all resultset, statement, and connection objects? : BEA Weblogic
what are the typical problems in web testing?
While creating class group if we didn't mention key name is it going display error it will save?
what is the percentage of W.C.T T.D.S to deduct from vendor, and is this includes T.D.S deduction or again T.D.S has to deduct separately?
Explain what is DOS (Denial of service) attack? What are the common forms of DOS attack?
What is button group and which class is used for basic button group?
What is meant by session replication?
Explain the routing technique known as “flooding.â€
How do I split a row in a table in word?
What is an alternator impedance value?
How many types of data classes are there in sap abap? : abap data dictionary
Which is the best tool one should learn i.e the tool having demand in the market for XSL?
What is the use of counting rules?
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