jaisa ki video m bhaiya n reverseRec functiion mein head ko by value pass kiya toh yani function m linked kist ki copy aai hogi . Toh jab function n value returm kari toh voh copy destroy ho jayegi ya nhi. If not why???
Confuison in memory allocation
@bvidab18
LinkedList by copy nhi jaati
LinkedList k head ka pointer by copy jaata hai
Toh jo bhi changes function mein huye hain woh retained rhenge function destroy hone k baad bhi
If your doubt is resolved please close it
bhaiya plz explain what will happen in the memory allocation and in variables of function if parameter is passed by value and by reference
@bvidab18
Discussing this topic in detail here is not possible
Please see this https://www.tutorialspoint.com/differences-between-pass-by-value-and-pass-by-reference-in-cplusplus
Otherwise try to google for it
There are plenty of links on it
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.