Discrete Math - 3.1.2 Searching Algorithms

preview_player
Показать описание
Linear search and binary search algorithms.

Video Chapters:
Introduction 0:00
Searching Problems 0:05
Linear Search 0:55
Linear Search Pseudocode 2:03
Binary Search 4:27
Binary Search Pseudocode 6:55
Practice 8:47
Up Next 10:40

Textbook: Rosen, Discrete Mathematics and Its Applications, 7e

Рекомендации по теме
Комментарии
Автор

Thank you so much for all that you do!! Education Should be free!!

andrewlowe
Автор

I believe that for the binary algorithm you missed the last couple steps. The while loop only breaks when the left endpoint is not less than the right endpoint.

So we would, after getting 8 for our midpoint: we would have a left endpoint of 6 and a right endpoint of 8.

Next step, 6+8/2 = 7. The a7 is less than x so the new left endpoint is now 8. Since the right and left endpoints and 8 (therefore breaking the while loop). We can then return the location since a8 = x.

shinyuta
Автор

Thank you. i can literally simulate the process with a table now

codex
Автор

they should have had me take this class before programming...

gabygarcia
Автор

Thanks so much for all of your videos, you're the only reason I'm getting through Discrete. I have an exam on chapters 3-5 coming up. Would you recommend this new playlist, or your old one? Is there a difference between the two?

mannyw_
Автор

Hi! Your videos are very informative. Thanks you so much! I have a question. Is the linear search algorithm recursive?

veronicathen
Автор

which software i used for these algorithms for applying practical?

engnuuraaniacademy
visit shbcf.ru