please see “deleteTail” function I am passing head by value but actual changes are reflecting in main. how is that happening?
Head passing by value but actual LL changing
Hey @krishnaSonavane, when you pass the head into any function, it doesn’t make a copy of the whole linked list, rather it just passes the pointer where the head is located and that’s the reason all the changes you make (like delete tail, insert at beginning etc.) are performed on the same linked list.
Hope this helps.