Bifalgorithm post
If you give me 1000 elements and ask me to find any target value, I can do middle element then there is no use of this rightmost area then we will ignore this and if this target value is greater than the middle element then there is no use of this leftmost area so we will ignore this thing and we will repeat all the three steps until we reach our target value. The time complexity of binary search is log v is 2 and if the size of array is 1000 then the value n will be 1000. In this case the value will come out to be 9.97 which is approximately equal to means we have to do only 10 comparisons if the size of the array is 1000. This algorithm is not just fast. It is a foundation of many more advanced algorithms. Follow us for more such deep dives. Thanks.
If you give me 1000 elements and ask me to find any target value, I can do middle element then there is no use of this rightmost area then we will ignore this…
Ideas in this flowchart
- Binary Search Explanation
- Binary Search Process
- Find Middle Element
- Ignore Right Area
- Ignore Left Area
- Repeat Steps
- Time Complexity
- Complexity: log base 2
- Array Size: 1000
- Comparisons: 10
- Algorithm Significance
- Foundation for Advanced Algorithms
- Follow for More Insights