During Insertion in Hash table we call the hash function which iterates over the string to give us the index so how is it O(1) , shouldnt it be O(string_length) ?
Doubt regarding Time Complexity of Insertion?
I hope you’ve doubt from this video. Please wait while I see the video. I’ll get back to you soon.
The video does not claim that it is O(1), however this claim if ever made means only in comparison to the number of strings and not to the number of characters of the string.
That is the time complexity is O(1) with respect to the number of strings, meaning that it doesn’t really matter on the counts of strings. But it will definitely be O(l), if l is the length of the string.