mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-28 21:00:56 +08:00
fix(curriculum): revise sentence in Searching and Sorting Algorithms Review (#64262)
This commit is contained in:
parent
b6c2373d20
commit
091adf3875
@ -25,7 +25,7 @@ In computer science, there are two searching algorithms you should know about. T
|
||||
### Binary Search
|
||||
|
||||
- Binary search works by dividing a list of items in half, and checking if the target value is in the middle of the list.
|
||||
- The condition for binary search to work is that the items in the list must be in ascending order.
|
||||
- The condition for binary search to work is that the items in the list must be sorted, either in ascending or descending order.
|
||||
- Binary search is a more efficient algorithm for searching through a large list of items because it divides the list of items in half and ignores any half where the target is not found.
|
||||
- If the target item is found in the middle of the list, the index of the target item is returned.
|
||||
- If the item is not found, the algorithm checks if the target item is in the left or right half of the list.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user