Why are we passing head by reference in getNode() funtion?

Why are we passing head by reference in getNode() function when we do not intend to change its value?

Hello @mehulbhandari358,

No, we are not changing the value of head in this function.
So, you can pass it by value too.
It won’t make any difference here.

Hope, this would help.