Linux file Lookup FindFile LookupLocateFile lookup: Finding eligible files on a file system relies on a pre-built Index library query system on the prebuilt file index database/VAR/LIB/MLOCATE/MLOCATE.DB system automatically implemented, periodic tasks. Manually created with a new database (UpdateDB, very consuming system resources) use with caution!Operating characteristics: Find Fast Fuzzy
database, the database is not real-time, waiting for the system to be idle, is automatically built at some point. So let's summarize the following main features of the command: locate: relies on pre-built index libraries, and if not, through a recurring task; System Auto-implementation (recurring task); manually update the database (updatedb); Working Characteristics: Find Fast; fuzzy find; Non-real-time lookup; The format of the Locate command
Text lookup: grep egrep fgrepFile Lookup: Locate, findThe difference between locate and findLocate has a self-maintained database (Linux self-built, associated with all files), Linux will periodically update it every day, and locate in this database to find, so the query is very fast, but the shortcomings are obvious, cannot be found in real time (for example, this command is not available when Linux is jus
File Lookup
So-called file lookups are based on the various attributes of a file to find the corresponding file under a specific path.i. how files are searched
Real-time lookup: Traverse all files for conditional matching. The search is accurate, but the speed is slow.
This lookup is implemented by the Find command.
Non-real-time
Source: "Bi thing" data stream conversion--word Lookup transformationThe term Lookup transformation matches the words extracted from the text of the converted input column to the words in the reference table, and then calculates the number of occurrences of the word in the lookup table in the input dataset and writes t
Objective
Data lookup is the basic computer programming work, and people have been studying it for many years. In this section you will see only one aspect of the lookup problem, which is to find it in a list (array) based on the given number.
There are two ways to find data in a list: Sequential lookup and two-in-pl
The first method:"Two-point search Requirements": 1. Sequential storage structure must be used 2. Ordered by keyword size."Advantages and Disadvantages" Binary search method has the advantage of less number of comparisons, faster search speed, good average performance; its disadvantage is that the table of discovery is ordered, and the insertion deletion is difficult. Therefore, the binary lookup method is
The first method:"Two-point search Requirements": 1. Sequential storage structure must be used 2. Ordered by keyword size."Advantages and Disadvantages" Binary search method has the advantage of less number of comparisons, faster search speed, good average performance; its disadvantage is that the table of discovery is ordered, and the insertion deletion is difficult. Therefore, the binary lookup method is
= 400000000byte = 400000000/(1024 * 1024) = 382 Mb, so the general PC server in this size can support, so the third problem is solved.
How to reduce the time by 5000w? In fact, this is also a search process, we think of the previous study of the search algorithm: Sequential lookup, binary lookup, binary sort tree lookup, index
In the kernel, the lookup is essential, such as the kernel manages so many user processes, now to quickly locateA process, which needs to be looked up, and there are multiple virtual stores in the address space of a process, and the kernel is fastLocate a virtual storage area of the process address space, which you need to find, and so on. One of the most used is tree-basedFind--------> Red and Black trees. and calculation-based
index of the first element in the array that is greater than key (i.e. the smallest element larger than key), and so on. These, although only a little bit of change, the realization of the time really need to be more careful. The implementation of these binary search variants is shown in:luoxn28/algorithm_data_structure. 2, Binary search treeBinary lookup tree for each node in the tree X, its left subtree all the keywords are less than the keyword of
(n) =o (f (n)), and F (n) represents a function when the amount of data is N.
and O (f (n)) refers to the time complexity of the algorithm when the amount of data is N.
He says the rate at which the algorithm executes increases with the increase in the size of the problem n. In this way, an uppercase O () is used to represent the complexity of the algorithm, called the Big O notation.
The general concern is the average time of the Big O notation, and the worst result of the time.
Some of th
is huge at the same time (especially in the backbone router scenario), the number of routing caches will far exceed the number of routing table entries, and I wonder where the route cache is compared to the query advantage of the routing table. Would there be such an efficient route cache query algorithm? If so, why not apply directly to the longest prefix-matching routing table
First, the order of the tree -two-fork tree-two fork to find the tree is explained more clearly.
One, the tree
A tree is a finite set of n (n≥0) nodes. In any of a non-empty tree:
(1) Having and having only a specific node called root;
(2) When n>1, the remaining nodes can be divided into m (m>0) disjoint finite set T1,T2,...,TM, in which each set itself is a tree and is called the root subtree (subtree). the degree of node (Degree): The number of sub
Binary search, also known as binary lookup, is a highly efficient method of finding.
"Two-point lookup Requirements": 1. Sequential storage structure must be used 2. Must be ordered by keyword size.
"Pros and cons" The advantage of binary lookup method is that the number of comparisons is small, the search speed is fas
In Linux, file lookups are commonly used with two commands, namely locate and find.
#locate based on locate database lookup, not real-time lookup, not exact lookup. Faster.
#find do not search according to the database, real-time lookup, traverse directory lookup, accurate
below: the first parameter: the content to be searched. In this example, it points to the A9 cell, that is, 7800; the second parameter: Compare the object region. In this example, the salary needs to be compared with the values in each cell in $ A $2: $ A $6; the third parameter: search result area. If it matches, the corresponding data in this area will be returned. In this example, the value corresponding to $ C $2: $ C $6 is returned. someone may ask, if the dictionary does not have a 780
results must be within the slot range.Once the hash value is computed, the element is inserted into the specified position in the hash table.5 what you see, attention. 6 Slots and One slot is empty, this introduces the concept of full-load factor, which is generally expressed as:λ= number of elements/hash table capacityOver here. It isΛ=6/11Now when we look for it, we simply use the hash function to calculate the slot value. Then check in the table
PrincipleBinary search also known as binary lookup, the advantages are less than the number of comparisons, Find Fast, the average performance is good, the disadvantage is that the unknown origin table is ordered table, and insert delete difficult. Therefore, the binary lookup method is suitable for an ordered list that does not change frequently and finds freque
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.