javascript--array-Associative (hash) array

Source: Internet
Author: User

The principle of associative (hash) arrays:

Hash algorithm: Receive a string to calculate a number that is not duplicated as much as possible
Different strings, calculate the number as different as possible
The same string, the calculated ordinal must be the same
When depositing data: The custom subscript name is given to the hash algorithm to calculate a sequence number that is as distinct as possible. The data to be saved is stored in the corresponding position of the serial number.
When the data is obtained: the subscript name to be searched is given to the hash algorithm, and then the exact sequence number is calculated and stored, and the element content is obtained directly from the array.
Pros: Find extremely fast, independent of data volume and storage location!

javascript--array-Associative (hash) array

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.