[algogeeks] Re: amazon ques

2011-09-30 Thread SAMMM
The hash table would be used by separate chaining method not open addressing because it may not find the correct entry efficiently in the hash table . In case of open addresssing the value gets entered in the first available entry after collision. In case of insertion :- (I have considered only si

Re: [algogeeks] amazon ques

2011-09-30 Thread manish kapur
@adi.. he gave a hint that space used should not b of order of range of numbers but should depend on how many numbers are inserted... eg..if range is say 1000...bt u entered only 5 nos ->8,100,202,600,989. u can use space of order 5..and not 1000 -- You received this message because you are subs

Re: [algogeeks] amazon ques

2011-09-30 Thread manish kapur
@somnath...can u pls elaborate... he was looking for an elaborate ans... -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks

Re: [algogeeks] Google Interview Question

2011-09-30 Thread arvind kumar
Hi Are u attending off-campus or on-campus interview? On 10/1/11, R@TH!$H wrote: > Hi, > > I am attending Google interview on Monday. Please help me with sample > questions. > > Thanks & Regards, > Rathish Kannan > > -- > You received this message because you are subscribed to the Google Groups >

[algogeeks] Re: Infinite Array

2011-09-30 Thread Shruti Gupta
We can use the following stategy: We consider range = 1 and search for given X among those 1 nos, if not found i.e. if X>a[range-1] , we increase range = range*2. If such right end is found , where a[range-1] > X, then we are sure that X is somewhere b/w index [0, range-1] . And now do simple b

[algogeeks] Google Interview Question

2011-09-30 Thread R@TH!$H
Hi, I am attending Google interview on Monday. Please help me with sample questions. Thanks & Regards, Rathish Kannan -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubs

Re: [algogeeks] Re: sony errcsn

2011-09-30 Thread vivek bhardwaj
if u knoe den temmee On Sat, Oct 1, 2011 at 11:01 AM, vivek bhardwaj wrote: > > :( > > On Sat, Oct 1, 2011 at 10:52 AM, shady wrote: > >> would have helped had you posted it properly. >> >> >> On Sat, Oct 1, 2011 at 10:50 AM, bihari wrote: >> >>> its urgent >>> >>> >>> On Oct 1, 9:31 am, bihari

Re: [algogeeks] Re: sony errcsn

2011-09-30 Thread vivek bhardwaj
:( On Sat, Oct 1, 2011 at 10:52 AM, shady wrote: > would have helped had you posted it properly. > > > On Sat, Oct 1, 2011 at 10:50 AM, bihari wrote: > >> its urgent >> >> >> On Oct 1, 9:31 am, bihari wrote: >> > plzzz tell me procedure about sony ercssn. >> > this compy will come i

Re: [algogeeks] Re: sony errcsn

2011-09-30 Thread shady
would have helped had you posted it properly. On Sat, Oct 1, 2011 at 10:50 AM, bihari wrote: > its urgent > > > On Oct 1, 9:31 am, bihari wrote: > > plzzz tell me procedure about sony ercssn. > > this compy will come in maah campus .. > > s pl give me info about this

[algogeeks] Re: sony errcsn

2011-09-30 Thread bihari
its urgent On Oct 1, 9:31 am, bihari wrote: > plzzz tell me procedure about sony ercssn. > this compy will come in maah campus .. > s pl give me info about thispl -- You received this message because you are subscribed to the Google Groups "Algorith

[algogeeks] Re: Amazon Interns

2011-09-30 Thread .itoa
BST ,very Large Input data problems, graphs (dfs bfs ,etc). which college ? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/xqxjYxJ3cP8J. To post to this g

[algogeeks] Amazon Interns

2011-09-30 Thread shiva@Algo
Amazon is Coming in our college ,Plz sugeest which subjects and what topic to focus for that ... -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this gro

[algogeeks] sony errcsn

2011-09-30 Thread bihari
plzzz tell me procedure about sony ercssn. this compy will come in maah campus .. s pl give me info about thispl -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to

Re: [algogeeks] amazon ques

2011-09-30 Thread SAMM
Linked List + Hash table will serve the purpose in O(1). On 9/30/11, Adi Srikanth wrote: > if space complexity is not a constraint..u can use any kind of hashing and > its function.depends on the kind of data we store..if its numbers go for > square or simple linear function > > > Regards

Re: [algogeeks] Amazon -> array problem

2011-09-30 Thread Hatta
just in case... start with: algo(1,0) On Fri, Sep 30, 2011 at 7:07 PM, Hatta wrote: > char A[] = { 1,2,3,4,5 }; > int algo(int b, int i) { >    if(i == sizeof(A)) { return 1; } >    int c = A[i]; >    int f = algo(b*c, i+1); >    A[i] = b*f; >    return f*c; > } > > > On Thu, Sep 29, 2011 at 8:2

Re: [algogeeks] Amazon -> array problem

2011-09-30 Thread Hatta
char A[] = { 1,2,3,4,5 }; int algo(int b, int i) { if(i == sizeof(A)) { return 1; } int c = A[i]; int f = algo(b*c, i+1); A[i] = b*f; return f*c; } On Thu, Sep 29, 2011 at 8:26 AM, raju wrote: > Given an integer array. { 1,2,3,4,5 } > Compute array containing elements > 120,6

[algogeeks] MULTQ3 Run Time Error

2011-09-30 Thread Aamir Khan
I am getting Run Time Error in MULTQ3 . I have implemented the segment tree and i can't understand why i can get the run time error in spoj judge. I tried to generate random input values and they ran fine on my system. If i try to increase the MAX value then TL

[algogeeks] Re: Amazon -> array problem

2011-09-30 Thread Brijesh
int main() { int a[]={4,3,5,2,6}; // 1 4 12 60 120 const int n=5; int temp=1,i; int b[5]={0}; for(i=0;i=0;i--) { b[i]*=temp; temp*=a[i]; } for(i=0;i > Given an integer array. { 1,2,3,4,5 } > Compute array containing elements > 1

[algogeeks] Re: How to Improve efficiency of this code? [SPOJ - HS11DIVS]

2011-09-30 Thread shady
use strings to multiply and other stuff in C++/C else use some other language On Oct 1, 12:13 am, ".itoa" wrote: > Bump.. Anybody? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@google

[algogeeks] Re: How to Improve efficiency of this code? [SPOJ - HS11DIVS]

2011-09-30 Thread .itoa
Bump.. Anybody? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/MFYbEg6sUjAJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscrib

Re: [algogeeks] Amazon -> array problem

2011-09-30 Thread Nitin Garg
@raju - so it means the input array should be distorted to give the output array. Are you sure about it? i doubt if its possible. On Fri, Sep 30, 2011 at 11:24 PM, raju wrote: > @nitin .. > Output array is not a new array ... you can do anything to input array .. > > ~raju > > > On Fri, Sep 30,

[algogeeks] Re: Amazon -> array problem

2011-09-30 Thread Abraham
Can we replace the operator (/) with 1^(-n) ? On Sep 30, 12:54 pm, raju wrote: > @nitin .. > Output array is not a new array ... you can do anything to input array .. > > ~raju > > On Fri, Sep 30, 2011 at 1:24 PM, Nitin Garg wrote: > > > > > > > > > Can we assume the output array is a new array a

Re: [algogeeks] Re: SAP!!

2011-09-30 Thread Adi Srikanth
in our college SAP had a online test, technical interview(some basic DSA questions) and HR round(Important here..they will verify how much interested you are...) Regards, Adi Srikanth. Mob No 9887233349 Personal Pages: adisrikanth.co.nr On Wed, Aug 31, 2011 at 12:31 PM, Nikhil Gupta wrote: > A

Re: [algogeeks] Amazon -> array problem

2011-09-30 Thread raju
@nitin .. Output array is not a new array ... you can do anything to input array .. ~raju On Fri, Sep 30, 2011 at 1:24 PM, Nitin Garg wrote: > Can we assume the output array is a new array and we can distort the > originial array??? > > > On Fri, Sep 30, 2011 at 9:14 AM, praveen raj wrote: > >>

Re: [algogeeks] Re: Infinite Array

2011-09-30 Thread Adi Srikanth
if its an array, you can get the size of an array from sizeof(array) divided by size of element typethen we can perform binary search Regards, Adi Srikanth. Personal Pages: adisrikanth.co.nr On Fri, Sep 30, 2011 at 8:47 PM, Don wrote: > @Ashima: It is a hypothetical question assuming a

Re: [algogeeks] amazon ques

2011-09-30 Thread Adi Srikanth
if space complexity is not a constraint..u can use any kind of hashing and its function.depends on the kind of data we store..if its numbers go for square or simple linear function Regards, Adi Srikanth. Mob No 9887233349 Personal Pages: adisrikanth.co.nr On Fri, Sep 30, 2011 at 9:43 PM

[algogeeks] can anybody tell me about the infibeam recruitment process??

2011-09-30 Thread tech rascal
-- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at ht

Re: [algogeeks] amazon ques

2011-09-30 Thread Devesh Mittal
Fibonacci Heaps On Fri, Sep 30, 2011 at 9:14 PM, manish kapur wrote: > u have to perform following tasks in O(1) time > 1.)insertion > 2.)deletion > 3.)searching > no range of input numbers is given > wat data structure will you use? > if u use hashing wat will be the key and value pairs? > > --

[algogeeks] amazon ques

2011-09-30 Thread manish kapur
u have to perform following tasks in O(1) time 1.)insertion 2.)deletion 3.)searching no range of input numbers is given wat data structure will you use? if u use hashing wat will be the key and value pairs? -- You received this message because you are subscribed to the Google Groups "Algorithm G

Re: [algogeeks] stack help

2011-09-30 Thread Shravan Kumar
http://groups.google.com/group/algogeeks/browse_thread/thread/1dd628ee5e7939da/decedd114a26e564?hl=en&lnk=gst&q=stack+problem# On Fri, Sep 30, 2011 at 7:41 PM, rahul sharma wrote: > plz post link as m not able to find it > > > On Fri, Sep 30, 2011 at 7:17 PM, sukran dhawan wrote: > >> already dis

[algogeeks] Re: Infinite Array

2011-09-30 Thread Don
@Ashima: It is a hypothetical question assuming an infinite array, which of course requires infinite memory. So don't worry about the compiler and other practical considerations. In real life the mass of the memory would cause it to collapse into a singularity long before the compiler would become

[algogeeks]

2011-09-30 Thread balaji a
Tujdqgtvg gR -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this

Re: [algogeeks] Re: Infinite Array

2011-09-30 Thread Ashima .
isnt this quest a lil wrong. coz suppose if i dnt know the length of an array,then how will i access the last element of the array.in such a case,i will almost traverse the whole memory and still not stop. coz compiler does not give array out of bound exception. Ashima M.Sc.(Tech)Information Syst

Re: [algogeeks] Median in logn

2011-09-30 Thread Shravan Kumar
http://www.ihas1337code.com/2011/03/median-of-two-sorted-arrays.html On Fri, Sep 30, 2011 at 8:03 PM, Shruti Gupta wrote: > Given two sorted arrays of size n each. Find the median of the array > obtained after merging the above two arrays in complexity logn?? > > > Shruti > Thapar University > >

Re: [algogeeks] Median in logn

2011-09-30 Thread NAMAN KOHLI
Hi This question can be done by observing the fact that if you take median m1 of the first array and the median of the second array m2 then the median of the sorted merged arrays can be found in the new array formed by :- If m1 < m2 taking the right of median m1 in the first array and the left el

[algogeeks] Median in logn

2011-09-30 Thread Shruti Gupta
Given two sorted arrays of size n each. Find the median of the array obtained after merging the above two arrays in complexity logn?? Shruti Thapar University -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email

Re: [algogeeks] stack help

2011-09-30 Thread rahul sharma
plz post link as m not able to find it On Fri, Sep 30, 2011 at 7:17 PM, sukran dhawan wrote: > already discussed.search in archives > > On Fri, Sep 30, 2011 at 6:29 PM, rahul sharma wrote: > >> hw will u design a stack which will have push pop and min fxn...all should >> operate in o(1) tymre

Re: [algogeeks] INTEL recruitment process

2011-09-30 Thread Aditya Virmani
college? On Thu, Sep 29, 2011 at 10:33 PM, aditya kumar wrote: > Guys does any one hve the idea about INTEL interview process for CS > students ?? The area they focus and types of question they ask . > If any have any idea plz help ! > thnks > > -- > You received this message because you are su

Re: [algogeeks] Tally Solutions Review

2011-09-30 Thread Aditya Virmani
ne idea abt how r thy gonna conduct their interview rounds? On Fri, Sep 30, 2011 at 12:18 AM, Sahil Garg wrote: > plz do tell.. > i also need sm intervw questions at the earliest.. > > Sahil Garg > Computer Engineering > Delhi College of Engineering > > > > On Thu, Sep 29, 2011 at 12:26 PM, Chun

Re: [algogeeks] stack help

2011-09-30 Thread sukran dhawan
already discussed.search in archives On Fri, Sep 30, 2011 at 6:29 PM, rahul sharma wrote: > hw will u design a stack which will have push pop and min fxn...all should > operate in o(1) tymreplyn asap > > -- > You received this message because you are subscribed to the Google Groups > "Algorit

[algogeeks] stack help

2011-09-30 Thread rahul sharma
hw will u design a stack which will have push pop and min fxn...all should operate in o(1) tymreplyn asap -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from

Re: [algogeeks] urgent soln needed

2011-09-30 Thread rahul sharma
i cnt get logic...xplain mre.thnx in advnce On Fri, Sep 30, 2011 at 6:16 PM, rahul sharma wrote: > plz xplain result after first scaning > > > On Fri, Sep 30, 2011 at 5:05 PM, Ankur Garg wrote: > >> @Rahul >> Scan the matrix and whenver u see a[i][j]=0 put a[i]]0]=0 and a[0][j]=0 >> >> Meaning

Re: [algogeeks] urgent soln needed

2011-09-30 Thread rahul sharma
plz xplain result after first scaning On Fri, Sep 30, 2011 at 5:05 PM, Ankur Garg wrote: > @Rahul > Scan the matrix and whenver u see a[i][j]=0 put a[i]]0]=0 and a[0][j]=0 > > Meaning to say that put that row or column as 0 > > Now, > Scan the first row and first column and whereever u see a 0

[algogeeks] Re: Infinite Array

2011-09-30 Thread pssaravanan
If the length of the array s not known,v could not apply the binary search to search for an element. i think following code will produce better solution. i = 0; for(i = 0;A[i] < p&& A[i] !=NULL;i = (i+1)^2); j = i; i = sqrt(i)-1; applybinarysearch(i,j); -- You received this message because you a

Re: [algogeeks] Sapient Help!!

2011-09-30 Thread Akanksha .
I m a 2011 passout n sapient had visited my clg in jan 2011.. first of all, u ll go thru a written test consising of apti ( quant, logical reasoning n english ) and one paper of c,ds n c++ combined... den u r shortlisted for technical interview in which dey ask u some puzzles n ques related to dbms

Re: [algogeeks] urgent soln needed

2011-09-30 Thread Ankur Garg
@Rahul Scan the matrix and whenver u see a[i][j]=0 put a[i]]0]=0 and a[0][j]=0 Meaning to say that put that row or column as 0 Now, Scan the first row and first column and whereever u see a 0 make that column and row 0 respectively Eg 1 1 1 1 0 1 0 1 1 1 1 0 Answer shud be 0 1 0 0 0 0 0 0 0

Re: [algogeeks] Sapient Help!!

2011-09-30 Thread Prags
@Akaknsha- hv sapient visited ur college ?? if yes , then what is its procedure ? On Wed, Sep 28, 2011 at 9:32 PM, Akanksha . wrote: > wrk culture is gud mostly.. if u want to do gud technical wrk den > avoid dis company otherwise if u r interested in management or nething > like dat den u can g

Re: [algogeeks] STRING help

2011-09-30 Thread rahul vatsa
c style string is just the char array which is null terminated. On Fri, Sep 30, 2011 at 1:27 AM, rahul sharma wrote: > what is c style string??n wats diff b/w c and c++ strings > representtaion.. > > -- > You received this message because you are subscribed to the Google Groups > "Algorit

Re: [algogeeks] Re: SPOJ PIGBANK Problem

2011-09-30 Thread manish patel
thanks man i got it .. :) On Fri, Sep 30, 2011 at 12:17 AM, Don wrote: > I think that it will fail if the value of the coins can be more than > 50001. > Don > > On Sep 29, 12:35 pm, manish patel wrote: > > http://www.spoj.pl/problems/PIGBANK/ > > > > please suggest some test case where it fails

Re: [algogeeks] Re: need soln

2011-09-30 Thread rahul sharma
i m doubtful...plz xplain On Fri, Sep 30, 2011 at 2:44 PM, geeks wrote: > void reverse(char str[]) > { > int i,j; > int n; > n=strlen(str); > for(i=0,j=n-1;i { > str[i]=str[i]+str[j]; > str[j]=str[i]-str[j]; > str[i]=str[i]-str[j]; > > } > } > > -- > You received this message because you are sub

Re: [algogeeks] urgent soln needed

2011-09-30 Thread rahul sharma
sorry n*m complex where n rows and m col but correct for space pzl and it uses two xtras array row and col On Fri, Sep 30, 2011 at 3:42 PM, rahul sharma wrote: > i cant find xact soln on previous threadi have sol with n*n complexity > but used space,, i.e > > scan whole matrix > if( matrix([

Re: [algogeeks] urgent soln needed

2011-09-30 Thread rahul sharma
i cant find xact soln on previous threadi have sol with n*n complexity but used space,, i.e scan whole matrix if( matrix([i][j]==1) { row[i]=1; col[j]=1; } scan agin if(row[i]==1 ||| col[j]==1) matrix[i][j]=0; two n*n loops so takes n*n and uses space too plz give me opt. soln On Fri, Sep

Re: [algogeeks] urgent soln needed

2011-09-30 Thread rahul sharma
provide me with o(1) space ...i need it vey urgent.can it be done...thnx in advance. On Fri, Sep 30, 2011 at 3:44 PM, rahul sharma wrote: > sorry n*m complex where n rows and m col > but correct for space pzl and it uses two xtras array row and col > > > On Fri, Sep 30, 2011 at 3:42 PM, rahul

Re: [algogeeks] Re: STRING help

2011-09-30 Thread rahul sharma
so reverse fun for ci.e user defines fxn will able to reverse c and c++ strings On Fri, Sep 30, 2011 at 3:07 PM, UTKARSH SRIVASTAV wrote: > NOC++ has only one additional data type that is bool.Rest everything > is designed as a class. > The c++ string is actually a class with overloaded

[algogeeks] quinstreet help......

2011-09-30 Thread sush57
can anyone post recruitment process of QuinStreet...that company is coming on 19th oct...plz help friends..what type of questions can be expectedplz help...thanks in advance -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to t

Re: [algogeeks] urgent soln needed

2011-09-30 Thread Yogesh Yadav
Already discussed https://groups.google.com/group/algogeeks/browse_thread/thread/8a3e1a6665702f54/66bb2e804b43ae1d?hl=en&lnk=gst&q=MS+question+ankur#66bb2e804b43ae1d . On Fri, Sep 30, 2011 at 2:59 PM, sumit kumar pathak wrote: > *find all the zeros in first iteration and store (size = array

Re: [algogeeks] Re: STRING help

2011-09-30 Thread UTKARSH SRIVASTAV
NOC++ has only one additional data type that is bool.Rest everything is designed as a class. The c++ string is actually a class with overloaded operators.. On Fri, Sep 30, 2011 at 2:30 AM, Mohan Varma wrote: > There's no data type called string in C. Strings are represented as > plain c

[algogeeks] Re: STRING help

2011-09-30 Thread Mohan Varma
There's no data type called string in C. Strings are represented as plain char arrays with a null character '\0' at the end.All the string functions like strlen() rely upon this convention. I'm not much familiar to C++, but C++ has a string data type. On Sep 30, 10:27 am, rahul sharma wrote: > w

Re: [algogeeks] urgent soln needed

2011-09-30 Thread sumit kumar pathak
*find all the zeros in first iteration and store (size = array bool [2n])* *and then make zero. * *time = O(n^2)* *space = O(n)* * * *case 2:* * if any zero whole matrix zero, (once we get a zero its row and column will become zero which in turn lead to whole matrix being zero). * * *regards - Sumi

[algogeeks] Re: need soln

2011-09-30 Thread geeks
void reverse(char str[]) { int i,j; int n; n=strlen(str); for(i=0,j=n-1;ihttps://groups.google.com/d/msg/algogeeks/-/ahYv91mn0X0J. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options

Re: [algogeeks] urgent soln needed

2011-09-30 Thread rahul sharma
it will zero only row not column On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze wrote: > > if(matrix[i][j]==0){ > for(int j=0;jmatrix[i][j]=0; > } > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this gro

[algogeeks] need soln

2011-09-30 Thread rahul sharma
how to reverse c style strin g -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more op

Re: [algogeeks] Re: How to Improve efficiency of this code? [SPOJ - HS11DIVS]

2011-09-30 Thread .itoa
nope. It fails for large numbers. number can go upto 10^100. first off , how to input such large numbers in c/c++ ? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/al

Re: [algogeeks] Amazon -> array problem

2011-09-30 Thread Nitin Garg
Can we assume the output array is a new array and we can distort the originial array??? On Fri, Sep 30, 2011 at 9:14 AM, praveen raj wrote: > Take two array... one will take care of left products... and othr will take > care of right product.. at any index left[i]=A[i-1]*left[i-1] starting

Re: [algogeeks] Re: How to Improve efficiency of this code? [SPOJ - HS11DIVS]

2011-09-30 Thread shady
got AC ? On Fri, Sep 30, 2011 at 11:23 AM, .itoa wrote: > *UPDATED *the first() function. Instead of using a loop , using m=a%x and > a = a-m+x to find the first divisible number. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To

[algogeeks] SOURCEBITS :: EXPERIENCE

2011-09-30 Thread aditya kumar
1st round was a written test . It had 30 mcq's . This was the easiest mcq's . 20 simple aptitude questions were thr along with some 10 C questions . 21 students were shortlisted for the first round . in the interview round they asked me basics questions possibly from all the subjects . 1) deadlock

Re: [algogeeks] Find lowest common ancestor of Binary Tree

2011-09-30 Thread anshu mishra
node* LCA(node *root, node *n1, node *n2, int &x) { int y = 0; node *temp; if (root->left) temp = LCA(root->left, n1, n2, y); x += y; if (temp != NULL) return temp; if (x == 2) return node; if (root->right) temp = LCA(root->right, n1, n2, y); x += y; if (temp != NULL) return temp; if (x == 2) ret