Loading...
Engaged Employer
How to remove a element from a single linked list a 3rd element when only the reference of it is given.
Anonymous
void removeElement(node n) { n.data = n.next.data; n.next=n.next.next; }
As you cant traversce in linked list back so we have to copy the content of next value in list to the current node(node to be removed)
Check out your Company Bowl for anonymous work chats.
Get actionable career advice tailored to you by joining more bowls.
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalized job recommendations and updates by starting your searches.