SumoLogic Interview Question
Software Engineer in TestsCountry: India
Interview Type: Phone Interview
When you say everything is preferably O(1), are you just saying that faster is better? Clearly "contains" can't be O(1) unless its probabilistic (or unless the data structure is defined to contain at -most O(1) elements...)
Hash Table is the optimal in this case. So simple and quick.
- Rolando August 05, 2014