We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I was wondering the same thing. He should have just use a hashtable. Using the ArrayList is going to have insertion time of O(n) for three of the first four elements added instead of O(1) for a hash table, never mind the unneccesary space taken by having a hashset and an arraylist
Equalize the Array
You are viewing a single comment's thread. Return to all comments →
I was wondering the same thing. He should have just use a hashtable. Using the ArrayList is going to have insertion time of O(n) for three of the first four elements added instead of O(1) for a hash table, never mind the unneccesary space taken by having a hashset and an arraylist