ADS1: Naive exact matching

  Рет қаралды 11,966

Ben Langmead

Ben Langmead

Күн бұрын

Пікірлер: 8
@bonbonpony
@bonbonpony 8 жыл бұрын
If this is the naïve algorithm, then what are better ways to do it?
@wejesuss-1104
@wejesuss-1104 3 жыл бұрын
boyer-moore
@sublime5969
@sublime5969 2 жыл бұрын
I highly appreciate your effort in the videos. Thank you! In the question: "How many character comparisons in this example?" Formula for the minimum is y - x + 1, I therefore got 32 as the minimum character comparisons. i.e 35 - 4 + 1 I got maximum character comparisons as 128 : x(y - x + 1) = 4 (35 - 4 + 1) = 128 I got 6 matches: w, wo, (in would) and w, wo, wor, word (in word) Sir, Could you please clarify how you achieved 41 minimum character comparisons and 40 mismatches
@Rcrdslns
@Rcrdslns Жыл бұрын
@sublime5969 In the presented case, the blank spaces are also counted, which are the 9 characters you are missing in your count. Hope this helps
@MikeVella
@MikeVella 5 жыл бұрын
isn't it 45 rather than 46 comparisons? aside from the two w characters there are only 4 other characters being matched (o and ord) so the number of comparisons should be 4 more than the worst case.
@khalidakram
@khalidakram 4 жыл бұрын
excellent
@ChimeraGilbert
@ChimeraGilbert Жыл бұрын
Couldn't you achieve the naive exact matching algorithm more efficiently by avoiding a double for-loop? Like this: `def naive_2(p, t): occurences = [] p_len = len(p) for i in range(len(t) - p_len + 1): if t[i:i+p_len] == p: occurences.append(i) return occurences`
@seifeldineslam
@seifeldineslam 3 жыл бұрын
Yes, 0 explanation. My favorite reasons to dislike a video.
ADS1: Practical: Matching artificial reads
6:54
Ben Langmead
Рет қаралды 7 М.
ADS1: Preprocessing
7:03
Ben Langmead
Рет қаралды 13 М.
Маусымашар-2023 / Гала-концерт / АТУ қоштасу
1:27:35
Jaidarman OFFICIAL / JCI
Рет қаралды 390 М.
Counter-Strike 2 - Новый кс. Cтарый я
13:10
Marmok
Рет қаралды 2,8 МЛН
Vampire SUCKS Human Energy 🧛🏻‍♂️🪫 (ft. @StevenHe )
0:34
Alan Chikin Chow
Рет қаралды 138 МЛН
ADS1: Solving the edit distance problem
12:32
Ben Langmead
Рет қаралды 17 М.
ADS1: Practical: Implementing Boyer-Moore
10:02
Ben Langmead
Рет қаралды 21 М.
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
Simon Sinek's Advice Will Leave You SPEECHLESS 2.0 (MUST WATCH)
20:43
Alpha Leaders
Рет қаралды 2,7 МЛН
ADS1: Assemblers in practice
8:34
Ben Langmead
Рет қаралды 8 М.
HashMaps & Dictionaries, Explained Simply
22:44
Nic Barker
Рет қаралды 13 М.
Superpositions, Sudoku, the Wave Function Collapse algorithm.
14:28
Martin Donald
Рет қаралды 711 М.
ADS1: Edit distance for approximate matching
9:18
Ben Langmead
Рет қаралды 11 М.
ADS1: Boyer-Moore: putting it all together
6:17
Ben Langmead
Рет қаралды 95 М.
String Matching 1. The Naive Algorithm
6:44
Computer Science Lessons
Рет қаралды 2,7 М.
Маусымашар-2023 / Гала-концерт / АТУ қоштасу
1:27:35
Jaidarman OFFICIAL / JCI
Рет қаралды 390 М.