3 ms·
While it is true that traversing the entire list takes O(n^2) time, it also takes O(n) time.
by anonymoushn 15y ago
While it is true that traversing the entire list takes O(n^2) time, it also takes O(n) time.
- deleted 15y ago[deleted]
- mdwe 15y agoHe is talking about the total creation time -- putting n distinct elements into the same hash bucket means traversing to the end n times for an overall o(n^2) time