how insertion taking o(1) time i am confused about it
How insertion taking o(1) time
Insertion in hashmaps generally take O(1) time but it also depends on the hash implementation.
According to the code it must be O(1) as there are no loops involved there.
You can read this
https://stackoverflow.com/questions/4553624/hashmap-get-put-complexity#:~:text=the%20general%20amortised%20complexity%20of,is%20backed%20by%20a%20List%20.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.