Make removeDupes run in linear time
In the previous version, removeDupes used Array.splice, which ends up moving the end of the array up in O(n) time, and makes the loop effectively O(n^2). This version uses a dictionary for bookkeeping so that duplicates can be removed in linear time. Change-Id: I78e23b97e9cc932ee653823674fcc19eb90be342
Showing
Please register or sign in to comment