Why we use hashmap when only one key can have one value? -


what use of hashmap when can associate 1 value 1 key. can directly search value insted of searching key..? right..? if not please explain.

key1---2->5->8->2; key2---->15->14; key3---45->15->10; if can search values using key less no. of iterations.

it comes in handy when know key of value need. if case, search time constant (doesn't vary size of array). yes, can search array, you'd have iterate it, leads linear delay (the greater array, longer take find needed value)


Comments

Popular posts from this blog

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -