The study of Array, Dictionary, Object 3 Big data structure and for

Source: Internet
Author: User

Array: storage-------Index Storage

Dictionary, Object: storage---------Hash Storage

The difference: It can be said that their keys correspond to their respective references, but the index storage requires that key be 0,1,2 ... this is done by a positive integer of the sequence. What is the difference, there are many times, we need our own data is arranged according to a certain rule, rather than disorderly order; For example, the data of a leaderboard, we want its storage structure is ranked by rank, so generally use index storage (Array), why not hash storage, Because we need to sort every time we use it, this undoubtedly increases the sort time, which is the benefit of index storage in accordance with this requirement.

For ... in, for each: To be sure, all of their keys are stored in a data structure Struct_key (named arbitrarily), and all of the Value is stored in a data structure struct_value. For ... in, is the traversal of the Struct_key; For each is a traversal of the struct_value.

The study of Array, Dictionary, Object 3 Big data structure and for

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.