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
Define What materials were used to build the Golden Gate Bridge?
What is the function of ‘git checkout’ in git?
What is the reason for sudden slump in value of rupee and bourses?
What is iis lockdown?
What is difference between import system.data.sqlclient,system.data.oledb?
What is skewness?
What is the difference between visual studio and visual studio code?
What is a frontend framework?
DOES IS 2062 SPECIFIES ONLY SEAMLESS PIPES OR ERW PIPE IS ALSO COVERED UNDER IS 2062
What are the functions performed by bynet?
What is the use of secondary methods in an activity?
What is the BS(British Standard)code for 11kv motor
Explain what are the steps to connect to a database?
I am getting above 60 V as open delta voltage against single phase unit ICT at tertiary delta formed and ICT getting trippped on NDR. ICT tested and found in order. PTs provided on tertiary are tested and in order. what may be the reason?