Hi, Everyone. This is @neko9!!
Today we will study search algorithms.
You studied the wood structure with me in a previous article.
Now it's time to explore that tree structure! (It's kind of exciting to hear the word "search," isn't it?)
↓previous article
https://steemit.com/hive-161179/@neko9/today-s-study-tree-structure
There are two explorations we will be studying
①linear search method
This method searches data sequentially from the top.
*A method that is particularly effective for unorganized data.
In this instance, that's the fifth one you'll find!
By the way, the average number of comparisons is (number of data + 1) / 2.
The linear search method also includes the "Banbei method," which simplifies the end of the search by adding the data to the end of the search.
②Two-minute search
This is a method of repeating the process of comparing just the median of the number of data with the data you want to explore.
This method is effective for data that is organized.
By the way, the average number of comparisons is log2N.
Huh? Then what about the average number of comparisons if there is no data to explore? I guess.
Rest assured, of course there is a way to calculate it!
average number of comparisons = (N + 1) / 2 * (1-a) + Na
(1) a = Probability of no search data
Oops, that was quite long.
I was going to write up to the study of the hash method, but let's leave that for the next time.
See you all in the next Today's Study.
@neko9 さん、こんにちは。
💡 アップボートガイド 💡
tomoyan.witnessに投票お願いします👇
https://steemitwallet.com/~witnesses
分からない事は何でも質問して下さい🙇
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit