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 a Service in SAP terminology?
How do I login to my joomla backend?
what is the default pp size in aix?
Hi, in Vendor Master i put in defualt data material in purchasing group in sap. now i want to report or list only purchasing group wise vendor only like subcontractor vendor list only how to get this?
What is cost element? : cost center accounting
How do you build rapport with pediatric patients and establish effective communication with them and their families?
hi... this is murali... i've attended for brigade interview for the first time...and got rejected in final technical hr round... can u sujjest me some questions on Windows XP Operating System, Ports and their pins, USB's, Basic Troubleshooting ... i have to attend again on 13th nov....
Explain how is siebel 7.x architecture different from siebel 6.x?
Is anything faster than c?
What are the different kinds of Routed events in WPF?
How do you plan to acheive targets assigned to you for a perticular period?
What is the degree of freedom in the robotics? How can it be determined?
write a C program that will determine whether a department -store customer ha exceeded the credit limit on a charge account. For each customer, the following facts are available: a. Account number (an integer) b. Balance at the beginning of the month c. Total of all items charged by this customer this month d. Total of all credits applied to this customer's account this month e. allowed credit limit The program should used a while statement to input each of this facts,calculate the new balance (=beginning balance=charges credits) and determine whether the new balance exceeded,the program should display the customer's account number, credit limit, new balance and the message "Credit Limit Exceeded".
Does python have do-while loop statements?
State the properties of a binary tree?