Block lookup/index sequential Lookup

Source: Internet
Author: User

Introduction:

Block lookup, also known as index ordered lookup, is an improved method for sequential lookup, with better performance than sequential lookup.

Method description:

Divide n data elements into M Blocks (the average block length is even, and the last block can be less than) (M <= N). Nodes in each block do not have to be ordered, however, the block and block must be "ordered by block". That is, the keywords in the first block must be smaller than (or greater than) the keywords in the second block, and those in the second block must be smaller than (or greater) the keywords in the third part are used to construct the index table. The index table is ordered by the keywords.

As shown in:


The figure below shows an index sequence table, which consists of three blocks. The actual address of the first block is 0, and the maximum keyword is 25. The actual address of the second block is 5, the maximum keyword in the block is 58, the starting address of the third block is 10, and the maximum keyword in the block is 88.

Basic Steps for multipart search:

Step 1. Select the largest keywords in each block to form an index table;

Step 2: The search is divided into two parts: Perform binary search or sequential search on the index table to determine which part of the record to be queried; then, use the sequential method to search for the identified block.

Block lookup/index sequential Lookup

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.