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
#include
Post New Facebook C Interview Questions
Good evening all I need a small favour regarding reliance paper i wanna probable sample papers(e&i) of reliance. if any of u have any idea about dis then plz mail me back.i belongs to electronics and instrumentation engg.so i need e&i papers. thanking u....
hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel
How do you ensure that your models are fair and unbiased?
Are you still writing code? Do you love it?
Write down ten test cases for below scenario: Increase the day by 1 and date format should be mm/dd/yyyy Conditions are : date should not be greater then 31 and date<1 month should not be greater then 12 and month<1 year should not be greater then 10000 and year<1 Thanks in advance
What is your UNIX experience and the types of UNIX systems you have worked on.
Hi, Can any1 pl send me the question pattern of HPCL exam for the ELECTRONICS stream.pl send it to meerasowmi@gmail.com.hope to hear frm u very soon....
hi, this is harish. i had finsihed cognos course recently.can some one help in the area of project explination, interview questions,real time scenarious....this is my maild id nanagupta907@gmail.com
I AM APPLY FOR CLERICAL CADRE IN SBI. SO ANYONE SEND ME QUESTION WITH ANSWERS, WHICH ARE RELATED TO THAT JOB. MY EMAIL ID IS shawetasingh24@gmail.com
what is the rate of 4000sqft rate, with material tile plumbing all work with plinth? Pl. Send ans. Yourlifeme@indiatimes.com
What are pointers? What are different types of pointers?
Please provide me the entire format of P.F. & ESI
plz send me paper of mppgcl 2008 or experience posted by any candidate
What is the difference between upgrade and migration in sql server?
How do I access a variable name programmatically?