3 ms·
Or it's O(log n). Depends on how collisions are handled.
by shrughes 14y ago
Or it's O(log n). Depends on how collisions are handled.
- timr 14y agoIf you use a balanced tree instead of chaining or probing, sure. But, of course, nobody ever does that in practice, because the complexity isn't justified by the theoretical gains. Point was, worst-case time complexity isn't constant. I'd be happy to see more people get that right in interviews.