LCA Implementation

why bhaiya has used pointers for p and q . p and q value is mentioned by the user so why its pointers are made???

code given in video is quite confusing. please tell same approach in simple manner

https://ide.codingblocks.com/s/261767 Please tell where I am doing mistake

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

Please help me to correct this code https://ide.codingblocks.com/s/261767