RUVIDEO
Поделитесь видео 🙏

Linear Search v.s Binary Search (Python) смотреть онлайн

In this video, I will explain binary search using a while loop and then using the recursive way. Specifically ,I will be demonstrating the binary search algorithm in a program iteratively (using a loop) and then recursively (using recursion).

The way binary search works is that you have a number that you want to search for in an array or a list. This array must be sorted from least to greatest as a precondition. If the number exists in the sorted array, you return the location (which is the index) where that number occurs. We call this number "the target". If the target does not exist inside the array, you simply return -1.

What is recursion? Recursion is a function that calls upon itself. Here, we write a function that calls upon itself to binary search an element or value inside an array using a for loop and using recursion. While it is easy to use a for loop or while loop to do this, it is important that you understand these recursion steps to have a strong foundation to learn more complex recursive algorithm in the future.

The way linear search works is that you have a number that you want to search for in an array or a list. If it exists in the array, you return the location (which is the index) where that number occurs. We call this number "the target". If the target does not exist inside the array, you simply return -1.

In the next video, I will explain binary search which is very similar to linear search, and I will also explain why it is so useful.

Link to the Linear Search in the Data Structure playlist: https://www.youtube.com/playlist?list=PLeTO6OT3-FKmuxOu4RtupTay1yrMp6QGC

LIKE & SUBSCRIBE:
? My Channel: www.youtube.com/c/QuocDatPhung
? My second channel: https://www.youtube.com/channel/UCtgROmYhSv97aE11LMiB7yg

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Linear Search v.s Binary Search (Python)» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.