您可能在某个地方提到过在 hashmap/dictionary/table 中查找元素比在 list/array 中查找元素更快。我的问题是为什么?
(到目前为止我做出的推论:为什么它应该更快,据我所知,在这两种数据结构中,它必须遍历直到到达所需的元素)
arrays search list hashmap time-complexity
arrays ×1
hashmap ×1
list ×1
search ×1
time-complexity ×1