We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
i was basically storing the address of the of each node through which we are passing for v1 and v2 in add1 and add2 respectively
i want to ask few questions:-
solution is a structure (in this question) , when we are calling Lca function (MYTREE.LCA(ROOT,V1,V2) , does the "instance of struct solution " will have --> add1[25] , add2[25], int i,j ; when function is called
on each function call (root=lca(root->left,v1,v2) ) in each "IF" statement does the add1[25] , add2[25], int i,j , will again take memory OR one single copy of add1[25] , add2[25], int i,j ; is only there, as only one insance is made;
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Binary Search Tree : Lowest Common Ancestor
You are viewing a single comment's thread. Return to all comments →