Frage im Vorstellungsgespräch bei Microsoft

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

Antwort im Vorstellungsgespräch

Anonym

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