algorithm - What is the time complexity of java.util.HashMap class' keySet() method? -


I am trying to implement a plane sweep algorithm and for this, I need to know the complexity of the method. I suspect that this is O (n log n) is i right?

The point of explanation: I'm talking about the complexity of the key set () method; He (N) will take the time clearly through the returned set again.

Actually, getting the keyset o (1) and cheap. The reason for this is the shipment. The key set () gives the actual keyset object related to the hashmap.

The key of the returned set is not copy , but there is a cover for the actual hashmap position. In fact, if you update the set then you can actually change the status of the hashmap; Like calling on the set clear () will clear the Hashmap!


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -