Addressing addressing
- In order to distinguish between things, humans describe and distinguish specific things.
- Everything in a computer is numbered and unique.
Such as:
- If the husband asks his wife to help him take the white sugar box on the tea table in the sitting room.
- The robot husband asked the robot wife to bring me the third room, the sixth furniture, and the ninth place. (Whether it was ink or a real candy box robot wife. I really want to crash the car. “” I really want to crash the car.”
- It must be said that “Turing” Niu B, before the invention of the abacus, the calculator, or PASCAL’s calculator, was finished with a specific task.
- Turing designed computers to perform complex functions through computation.
Whereas computing had been an end, Alan saw it as a means, and achieving some function as an end
Turing machine model
All numbers are placed in numbered (address) boxes. When the computer operates on the data, it says find the box and take out the contents of the box. Then put it back in the box.
Use a mathematical model to describe the computer. Let’s say we use variables x,y, and z to make the mathematical formula clear.
- 1. When we add, we usually go straight to the number 1+2 = 3,
- (1) x+y = z, substitute 1 and 2 into x and y. (2) Add x+y
How to quickly find which numbers in the computer is the art of computing, also known as “lookups”
To find the
- Sequential search: according to the order of a search, stable, than random random search reliable, avoid repetition.
- Binary search is to guess a number in mind by asking whether it is less than xx many times, such as 0-1000, the first ask 500, the second ask 250 or 750, each time half the question. It can be found after several times (if the data is ordered and static)
example
If you want to find li Qiang from all over Shenzhen, and he works in Tencent, find him who graduated from Shenzhen University.
As follows
In order to find
At this time Li Qiang’s information is disordered, the search needs to check the whole shenzhen people.
Binary search
What if we rank them by people?
At this point, Li Qiang’s data becomes ordered and concentrated. We only need to use binary search, dozens of times to find Li Qiang. But it can only be one of them, at this time there will be three of the same, but also continue to go forward or back to the rest of the li Qiang name related units in the graduate school match to find. If you have thousands of li Qiang, you still have to look up in order from the bottom up, and from the top down.
If you want to improve the order of the search time, such as to find Tencent work Li Qiang, you need to copy the database, and then sorted by units, and then take the intersection of name and unit. It’s also a hassle.
indexing
This ignores that each piece of data actually has a unique number, as shown below
At this time, as long as another set up an index relationship table, the name and number 1 to maintain the relationship, the same: unit and number also set up an index table.
In this way, it is necessary to find li Qiang in 1, 4 and 7, and take the intersection with the unit index. To find the intersection of 3, it is to find Li Qiang who works in Tencent.
Google searches are based on indexes
How Google can query millions of documents in a millisecond. Google downloads every document it can find on the web and indexes every word, such as “li qiang” on page 101, 3,10,59, 655, 30,54,889. In this way, when users search for “Li Qiang”, they can find all the corresponding indexes, and then list them all at once.
- Google Bull b is a unified index of all words, regardless of language.
- Many small companies may only index useful keywords and distinguish languages, Chinese an index library, English an index library.
Windows vista’s failure
Vista is an operating system that emphasizes personal local search, but improving search efficiency comes at a cost: time for space. Creating a local index takes up 50% of the original information. And every time there are data changes will trigger the index table changes, a large amount of memory resources.
This is putting the cart before the horse, the operating system should give users more resources to run the software they need to run.
- While “search” is a necessity, local search is not necessarily a necessity, and the data is user-generated, and users generally know where it is.
- Just as many entrepreneurial projects say that mobile phone charging is just needed, so the charging bank is just needed.
The reason Why Google can spend so much money on indexing is because so many people around the world use it, and the marginal cost of each search decreases, offsetting the cost of indexing. Of course, if you don’t do a Google search, it really isn’t worth it.