Binary Search
October 12, 2022
local_offer
Algorithm
Binary Search is a search algorithm.
It requires a sorted collection to make it work.
This search algorithm is simple yet quite powerful.
Performance
The worst-case performance is O(log n).
The best-case performance is O(1).
The average performance is O(log n).
Floor division in Python
To get the midpoint, I needed floor division.
Here is how to write floor division in Python.
mid = low + (high - low) // 2
Latest Posts
Graph Data Structure
January 06, 2023
Bitwise operation
December 02, 2022
How Networking Works
December 01, 2022
Sorting Algorithms
November 27, 2022
Difference between Array and Linked List
October 17, 2022