Code below... Continuing our series investigating algorithms in Python, in this video we’ll cover the Binary Search, a highly efficient searching technique that only applies under certain conditions. In the beginning of the video we’ll go over the basics of the binary search, and later we’ll open up our coding editor and actually implement the algorithm using Python.
► Python 2
► Python 3
► Python Data Structures:
► Video series covering GUI development in Python (WIP):
References:
[1]
[2]
[3]
In computer science, binary search, also known as half-interval search, logarithmic search, or binary chop, is a search algorithm that finds the position of a target value within a sorted array. Binary search compares the target value to the middle element of the array; if they are unequal, the half in which the target cannot lie is eliminated and the search continues on the remaining half until it is successful. If the search ends with the remaining half being empty, the target is not in the array.
Binary search runs in at worst logarithmic time, making O(log n) comparisons, where n is the number of elements in the array, the O is Big O notation, and log is the logarithm. Binary search takes constant (O(1)) space, meaning that the space taken by the algorithm is the same for any number of elements in the array. Although specialized data structures designed for fast searching—such as hash tables—can be searched more efficiently, binary search applies to a wider range of problems.
1 view
0
3
1 month ago 00:09:49 1
How does a Tank work? (M1A2 Abrams)
1 month ago 00:01:42 1
Karl Bartos - The Binary Code
2 months ago 05:27:20 1
70 Leetcode problems in 5+ hours (every data structure) (full tutorial)
2 months ago 00:54:41 1
Tech Weeklies - Theorem proving: What, how and why? - Isabelle/HOL - 08/21 - Jan van Brügge
2 months ago 00:07:09 9
Single Number - Leetcode 136 - Python
3 months ago 00:03:20 1
Trance Reserve & SinStar - Down The Hill
3 months ago 00:02:39 1
Abebayosh - አበባዮሽ Ethiopian Happy New Year Song እንቁጣጣሽ Enkutatash 3D Animation Amharic Music
3 months ago 00:45:45 1
Astrophysicists Explore The Latest in Exoplanet Discovery
3 months ago 00:03:54 1
7.7⭐ -semi | LiSA - ADAMAS [Binary] % FC #1 | 484pp - osu!
3 months ago 02:02:12 1
CS50x 2024 - Lecture 3 - Algorithms
4 months ago 00:00:00 1
✨ star wars lofi
5 months ago 00:21:47 1
Post-Production Explained — Each Step of the Post-Production Process [Stages of Filmmaking, Ep 4]
5 months ago 00:39:23 24
Юрий Грибов — Как правильно писать компараторы
5 months ago 01:08:30 1
Trance Classics Mix
5 months ago 03:27:10 1
The 30 Best Trance Music Songs Ever (Armin van Buuren, Ferry Corsten, Rank 1, Push)
6 months ago 00:10:43 1
Российский трюфель - поиск с микологом Вишневским,
6 months ago 03:18:05 1
♦ Armin van Buuren’s Top 30 Trance Songs ♦
6 months ago 00:15:37 1
OPEN SOURCE alternatives to the MOST POPULAR productivity apps!
7 months ago 09:48:45 1
Data Structures and Algorithms in C | C Programming Full course | Great Learning
7 months ago 00:32:44 18
HackTheBox - Analytics
8 months ago 00:12:01 1
Интервью Яндекс. Найти пропущенное число используя 128 KiB Часть 1/3
8 months ago 00:06:36 1
Интервью Яндекс. Найти пропущенное число используя 128 KiB Часть 2/3
8 months ago 00:27:32 1
Интервью Яндекс. Найти пропущенное число используя 128 KiB Часть 3/3
8 months ago 00:06:15 1
Алгоритмы: бинарный поиск на отсортированном массиве (реализация на Java)