Binary-search

Level: Beginner

1. Implement the basic Binary Search algorithm on a sorted array.
2. Write a function to find the first occurrence of a target value in a sorted array using Binary Search.
3. Write a function to find the last occurrence of a target value in a sorted array using Binary Search.
4. Implement a function to find the number of occurrences of a target value in a sorted array using Binary Search.
5. Write a function to find the smallest element in a sorted rotated array using Binary Search.
6. Implement a function to find the peak element in an array using Binary Search.
7. Write a function to find the square root of a number using Binary Search.
8. Implement a function to search for a target value in a nearly sorted array using Binary Search.
9. Write a function to find the position of the first element greater than or equal to a target value in a sorted array using Binary Search.
10. Implement a function to find the position of the last element less than or equal to a target value in a sorted array using Binary Search.
11. Write a function to find the floor of a target value in a sorted array using Binary Search.
12. Implement a function to find the ceiling of a target value in a sorted array using Binary Search.
13. Write a function to find the element closest to a target value in a sorted array using Binary Search.
14. Implement a function to find the first bad version in a sequence using Binary Search.
15. Write a function to search in a sorted array of unknown length using Binary Search.
16. Implement a function to find the missing number in a sequence of consecutive numbers using Binary Search.
17. Write a function to search for a target value in a bitonic array using Binary Search.
18. Implement a function to find the k-th smallest element in a sorted matrix using Binary Search.
19. Write a function to find the rotation count in a sorted rotated array using Binary Search.
20. Implement a function to find the fixed point in a sorted array using Binary Search.
21. Write a function to find the pair of elements with the closest sum to a target value in a sorted array using Binary Search.
22. Implement a function to find the median of two sorted arrays using Binary Search.
23. Write a function to perform Binary Search on a linked list.
24. Implement a function to find the element that appears only once in a sorted array where all other elements appear twice using Binary Search.
25. Write a function to find the maximum element in a bitonic array using Binary Search.
26. Implement a function to find the smallest missing positive number in an array using Binary Search.
27. Write a function to find the index of the first 1 in an infinite binary sorted array using Binary Search.
28. Implement a function to count the number of 1s in a sorted binary array using Binary Search.
29. Write a function to find the smallest number greater than a given number in a sorted array using Binary Search.
30. Implement a function to find the largest number smaller than a given number in a sorted array using Binary Search.

Intermediate Level: View

Advanced Level: View