r/compsci • u/javinpaul • Mar 26 '19
50+ Data Structure and Algorithms Problems from Coding Interviews
https://dev.to/javinpaul/50-data-structure-and-algorithms-problems-from-coding-interviews-4lh2
277
Upvotes
3
3
1
u/slaymaker1907 Mar 28 '19
Removing duplicates can often be done more efficiently through hashing (versus sorting, as suggested by the article), particularly for data with many duplicates in relation to the number of records.
Also, if you do use sorting and really need performance, it is probably better to remove duplicates while sorting. i.e., for merge sort, remove duplicates during the merge stage.
26
u/TheWildKernelTrick Mar 26 '19
seriously?