What are hashtables and hashmaps and their typical use cases?

后端 未结 4 690
伪装坚强ぢ
伪装坚强ぢ 2021-01-30 01:38

I have recently run across these terms few times but I am quite confused how they work and when they are usualy implemented?

4条回答
  •  无人共我
    2021-01-30 02:11

    if you are talking in terms of Java, both are collections which allow objects addition, deletion and updation and use Hasing algorithms internally.

    The significant difference however, if we talk in reference to Java, is that hashtables are inherently synchronized and hence are thread safe while the hash maps are not thread safe collection.

    Apart from the synchronization, the internal mechanism to store and retrieve objects is hashing in both the cases.

    If you need to see how Hashing works, I would recommend a bit of googling on Data Structers and hashing techniques.

提交回复
热议问题