Frage im Vorstellungsgespräch bei Urgently

Remove duplicate LinkNodes from a sorted LinkNode list.

Antwort im Vorstellungsgespräch

Anonym

15. Juli 2023

Store the first node value and ptr in a variable and then use a while loop to iterate over the list until ptr is null and compare the next Node’s value with the previously known non-duplicate and update the ptr reference as needed.