Question d’entretien chez Microsoft

differences between linked and doubly linked list? remove duplicates from array?

Réponse à la question d'entretien

Utilisateur anonyme

10 nov. 2014

A doubly linked list will have a pointer to the next AND the previous node while a linked list will only have a pointer to the next node. To remove duplicates array I would say put them into a hashset. If you need to use O(n) memory I would think you need to do a sort but that what take at worst O(nlogn) time