Query table: A set composed of data elements or records of the same type, that is, the set of all data to be queried.
Keyword: the value of a data item in a data element, also known as a key value, can be used to identify a data element that is not necessarily unique. It can also represent a data item field of a record. Do we call it key.
Primary Keyword: If this keyword uniquely identifies a record, it is called as the primary keyword, which means that different records have different primary keywords. The data item where the primary keyword is located is the primary key code.
Secondary Keyword: identifies multiple data elements or records. Secondary keywords can be understood as keywords that do not uniquely identify a data element or record. The corresponding data item is the secondary key code.
Search: determines a data element or record whose keyword is equal to the given value in the search table based on a given value ). If such a record exists in the table, the query is successful. The query result is the information of the entire record or the position indicated by the record in the query table ). If no keyword in the table is equal to the given value, the query is unsuccessful. In this case, the search result can provide an "null" record or a "null" pointer.
Search Table Category: static search table and dynamic search table.
Static search table: Only search tables for search operations. Its main operations include:
1) query whether a "specific" data element is in the query table.
2) retrieve a "specific" Data Element and Its attributes.
Dynamic table search: inserts a nonexistent data element during the search process, or deletes an existing data element from the search table. Search for Dynamic tables:
1) insert data elements when searching.
2) delete data elements when searching.
To improve search efficiency, we need to set up a data organization for search operations. This data structure for search operations is called a search structure.
Logically, the data structure on which the query is based is set, and there is no essential relationship between records in the set. However, to achieve high search performance, we can not change the relationship between data elements. during storage, we can organize the search tables into tables and tree structures.
For example, for a static search table, we may wish to apply a linear table structure to organize data, so that we can use the sequential search algorithm. If we sort the primary keywords, you can use the half-lookup count to perform efficient searches.
If you need dynamic search, it will be more complicated. You can consider the Query Count of the binary sorting tree.
In addition, you can use the hash count to solve the search problem.
This article is from "Li Haichuan" blog, please be sure to keep this source http://lihaichuan.blog.51cto.com/498079/1282306