why bhaiya has used pointers for p and q . p and q value is mentioned by the user so why its pointers are made???
LCA Implementation
code given in video is quite confusing. please tell same approach in simple manner
Hey,we are genrally given pointer to the two nodes for which we need to find lca
Hence we have to use pointer only.
If values are given for the node then we can use that value in comparsion.
But again it depends on what is given to us
Go through this link,they have explained pretty well