Bifalgorithm post

Have you ever tried to find a word in dictionary? You don't start from the page one, right? You open somewhere in the middle. If the word is Java, you instantly know Python will be after this alphabetically. So what do you do? You ignore the left half and start searching on the right side. And again, you follow the same process until you find the word. This searching technique is known as binary search. And that's exactly how binary search works. It doesn't waste time. It cuts the search space in half every single time equals to target Bravo, we find the target. If mid-element less than target, we ignore the right and continue search in the left side. If mid-element is greater than target, we ignore left and continue search in the right side. Keep halving the list until you find the target. And that's the power of binary search. Faster than checking one by one, and smarter than guessing randomly.

Have you ever tried to find a word in dictionary? You don't start from the page one, right? You open somewhere in the middle. If the word is Java, you instantl…

Ideas in this flowchart

  • Binary Search Explanation
  • Search Process
  • Start in Middle
  • Compare with Target
  • Halve Search Space
  • Advantages
  • Faster than Linear Search
  • Efficient Search Strategy
  • Mid-Element Equals Target
  • Target Found
  • Mid-Element Less Than Target
  • Ignore Left Half
  • Mid-Element Greater Than Target
  • Ignore Right Half
Feed/

Have you ever tried to find a word in dictionary? You don't start from the page one, right? You open somewhere in the middle. If the word is Java, you instantly know Python will be after this alphabetically. So what do you do? You ignore the left half and start searching on the right side. And again, you follow the same process until you find the word. This searching technique is known as binary search. And that's exactly how binary search works. It doesn't waste time. It cuts the search space in half every single time equals to target Bravo, we find the target. If mid-element less than target, we ignore the right and continue search in the left side. If mid-element is greater than target, we ignore left and continue search in the right side. Keep halving the list until you find the target. And that's the power of binary search. Faster than checking one by one, and smarter than guessing randomly.

"Have you ever tried to find a word in dictionary? Y"

👍
0
0 comments0 shares

Sign in to view and post comments.