Pass by reference

if in insert function trie root is not passed by address or reference then how it has changes in main function

@neerav

yes head is not pass by reference but changes reflect back to main

because we are passing addresses

function also copy the address of head->left and head->right
and change happens through these addresses so we can say that left and right is pass by reference as there address are passed
so changes will reflect to main

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.