Head pointer passed by reference

I am confused in head pointer pass by reference or pass by value in the linked list .please clarify it.

@rohit_2425
Understand in a simple way, if you pass a variable by reference then you don’t need to update it again after the function call(not to return that thing from function).
But if you pass it by value then just a copy of that variable is passed which has different address in memory location so you have to update the head in that case, after the function call is over.

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.