title: Why is the cost of a hash lookup O(1) when evaluating the hash function might take more time than that?
body: <p>A HashMap (or) HashTable is an example of <strong>keyed</strong> array. Here, the indices  are user-defined keys rather than the usual index number. For example, <code>arr["first"]=99</code> is an example of a hashmap where theb key is <strong>first</strong> and the value is 99.</p>
  
  <p>Since keys are used, a hashing function is required to convert the key to an index element and then insert/search data in the array. This process assumes that there are <strong>no collisions</strong>.</p>
  
  <p>Now, given a key to be searched in the array and if present, the data must be fetched. So, every time, the key must be converted to an index number of the array before the search. So how does that take a O(1) time? Because, the time complexity is dependent on the hashing function also. So the time complexity must be O(hashing function's time). </p>