Map vs List w.r.t searching Time complexity
问题 You might have come across someplace where it is mentioned that it is faster to find elements in hashmap/dictionary/table than list/array. My question is WHY? (inference so far I made: Why should it be faster, as far I see, in both data structure, it has to travel throughout till it reaches the required element) 回答1: Let’s reason by analogy. Suppose you want to find a specific shirt to put on in the morning. I assume that, in doing so, you don’t have to look at literally every item of