mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-25 00:36:27 +08:00
translation: Update algorithms_are_everywhere.md (#998)
* Update algorithms_are_everywhere.md I made changes to yuelinxin's suggestions. again thank you so much for your suggestion yuelinxin! * Update algorithms_are_everywhere.md
This commit is contained in:
parent
9d9d9e74b9
commit
060a028008
1 changed files with 2 additions and 2 deletions
|
@ -4,10 +4,10 @@ When we hear the word "algorithm", we naturally think of mathematics. However, m
|
|||
|
||||
Before we formally discuss algorithms, an interesting fact is worth sharing: **you have already learned many algorithms unconsciously and have become accustomed to applying them in your daily life**. Below, I will give a few specific examples to prove this point.
|
||||
|
||||
**Example 1: Looking Up a Dictionary**. In a standard dictionary, each word corresponds to a phonetic transcription and the dictionary is organized alphabetically based on these transcriptions. Let's say we're looking for a word that begins with the letter $r$. This is typically done in the following way:
|
||||
**Example 1: Looking Up a Dictionary**. In an English dictionary, words are listed alphabetically. Suppose we're searching for a word that starts with the letter $r$. This is typically done in the following way:
|
||||
|
||||
1. Open the dictionary around its midpoint and note the first letter on that page, assuming it to be $m$.
|
||||
2. Given the sequence of words following the initial letter $m$, estimate where words starting with the letter $r$ might be located within the alphabetical order.
|
||||
2. Since $r$ comes after $m$ in the alphabet, we exclude the first half of the dictionary and narrow the search to the second half.
|
||||
3. Iterate steps `1.` and `2.` until you find the page where the word begins with the letter $r$.
|
||||
|
||||
=== "<1>"
|
||||
|
|
Loading…
Reference in a new issue