Binary search can be upgraded to the following five variants -
- Index of a particular key
- Index of the first occurrence of a key
- Index of the last occurrence of a key
- Index of least element greater than key
- Index of greatest element less than key
Index of a particular key / Basic Binary search
Index of the first occurrence of a key
Index of the last occurrence of a key
Index of least element greater than key
Index of greatest element less than key
Conclusion
This is the end of the blog. Make sure to give a follow if you liked this.
Thanks💛