We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
What we original did was initialize the 'node' variable on head to the same memory space, aka the same object. then node traverses the linked list. This operator allows us to keep a pointer to head so we can still print out the entire linked list. think of the pointer as a bookmark, but instead of saving a page in a book, it is saving the place where we keep head in memory.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Delete duplicate-value nodes from a sorted linked list
You are viewing a single comment's thread. Return to all comments →
I will attempt to try.
Try running this bit of code and see see the output
What we original did was initialize the 'node' variable on head to the same memory space, aka the same object. then node traverses the linked list. This operator allows us to keep a pointer to head so we can still print out the entire linked list. think of the pointer as a bookmark, but instead of saving a page in a book, it is saving the place where we keep head in memory.