Welcome to the Binary Search Practice Questions repo β your go-to resource to master one of the most fundamental and powerful techniques in algorithm design: Binary Search.
This repository contains hand-picked LeetCode-style problems, each solved using Python, with a focus on clarity, efficiency, and conceptual depth.
A collection of classic and advanced binary search problems with explanations and Python implementations to master binary search efficiently.
Each file is named according to the practice question number and includes:
- π§ Clear problem description
- π οΈ Efficient binary search implementation
- π¬ Helpful comments for learning
- π Problem inspired by LeetCode
| File Name | Problem Description |
|---|---|
| Practice_Question1.py | Count negative numbers in a sorted matrix |
| Practice_Question2.py | Find next greatest character in a sorted array |
| Practice_Question3.py | Print index of the target in a list |
| Practice_Question4.py | Find the minimum number in a rotated array |
| Practice_Question5.py | Search in rotated sorted array |
π These problems are directly or indirectly based on LeetCode questions. You can find them all (and more) on leetcode.com.
Binary search is essential for:
- Coding interviews (FAANG, startups, etc.)
- Competitive programming
- Reducing time complexity to
O(log n) - Mastering algorithmic thinking
- Clone the repo:
git clone https://github.com/Algorithm-Artist-ctrl/Binary-Search-Practice-Questions.git