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
What is the _jspservice() method?
What is the difference between data loader and import wizard?
What is zone of equivalence?
can u please mail me the syllabus for GET exam for damodar valley corporation?
What is the purpose of pivot stage and types of containers in datastage
What are pivot tables and also mention its use?
How to do headhunting in information technology profiles? The recruiting is different in this kind of profiles?
Write a program to download the contents from www.perlinterview.com/answers.php website in Perl.
Is there any thread in our .net programs?
How to record a qtp script ?
In horses coat color is dependent upon genes as follows: A_B_ results in bay, aaB_ in black, A_bb in chestnut, aabb in liver. In addition, palimino is derived by Dd with chestnut. A palimono stallion (DdAAbb) is crossed with a palimino mare (DdAAbb). What percent of the offspring will be palimino?
When should I use a custom login module versus a TAI to assert identity information?
I HAVE DONE B. SC . (BIO) AFTER THAT I HAVE DONE MBA HR AND NOW MANY INTERVIEWER ASK ME WHY I HAVE HONE MBA IN HR? PLZ ANSWER ME?
What is razor? : asp.net mvc
What is unicode used for?