17. Binary Search Algorithm – Theory + code.
Binary search is a widely used search algorithm that works efficiently on sorted arrays or lists. It is a divide-and-conquer algorithm that repeatedly divides the input into smaller subproblems, and eliminates one half of the remaining elements at each iteration based on a comparison of the middle element with the target element being searched.
The algorithm begins by comparing the target value to the middle element of the array or list. If the target value is smaller than the middle element, then the search is restricted to the lower half of the array, and the search continues on this half. If the target value is larger than the middle element, then the search is restricted to the upper half of the array, and the search continues on this half. The process is repeated until the target value is found, or the search space is empty.
Binary search has a time complexity of O (log n), which makes it significantly faster than linear search (which has a time complexity of O(n)) for large arrays. However, binary search requires that the array be sorted beforehand, which can add extra time complexity if sorting is required. Binary search is widely used in computer science and has applications in many areas, such as searching in databases, searching in file systems, and searching in web pages.
Time Stamp:
00:00 - Intro
00:05 - Binary Search Theory
08:07 - Binary Search Code
14:02 - Linear Search Vs Binary Search Time Complexity
22:00 - Binary Search when array elements in Descending order
25:38 - OrderAgnostic Binary Search
36:00 - Outro
Notes:
https://drive.google.com/file/d/1QFcch9CnOmvFl06_oGwWzETkqAcaNF5W/view?usp=share_link
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «17. Binary Search Algorithm – Theory + code.», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.