What is the hashmap?
In computer science, hashmap or hash table is a form of structuring data, so each part of the data is connected to a unique identification number or symbol. This allows easy search, especially from a large database containing thousands of items. Hashmap is not a specific part of the program, but rather refers to a form of a data organization that assigns each item known as the key, in the database to the value that is for this item. The hash function is part of the program that connects the keys to their values.
The phone books serve as an excellent example of the hashmap. The way in which the telephone book is determined represents the structure of the hashmap. It focuses on connecting different values and connecting only one value with one other corresponding term or telephone number. The names in the phone book are keys and phone numbers are the values associated with them. Each person in the book is assigned a different number and no two are similar. Mailing boxes
Hashmap metaphor.Every person has a key to a single box. The box can have some information - accounts, letters, postcards - all intended for individuals who have the key to the box. When the correct key is inserted into the correct field or coincides with the right box, its contents open.
perfectly functioning hashmaps would connect one key to one "field" in a computer database. Unfortunately, a factor known as a hash collision can occur, where two keys go to the same box. This happens when a large amount of data is entered and there is not enough “boxes” that would suit everything.
In contrast to the phone book or mailbox, the hashmaps include in addition to the key and the value or box it corresponds to, the third element. It also includes a hash function. The person knows which mail is hers but must be communicated to the computer that the key goes to which field. Hash Funuction looks turnkey, converts it to a number of numbers or code and propoIt is with a box that contains the corresponding code. The name of the key, such as "Mary", is only there, so it is easier for people to interpret, while the actual code is a string of numbers to read.