Skip to content

Commit 7c1c812

Browse files
authored
Sync docs for practice exercise binary-search (exercism#2378)
1 parent c1952aa commit 7c1c812

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

exercises/practice/binary-search/.docs/instructions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ Your task is to implement a binary search algorithm.
55
A binary search algorithm finds an item in a list by repeatedly splitting it in half, only keeping the half which contains the item we're looking for.
66
It allows us to quickly narrow down the possible locations of our item until we find it, or until we've eliminated all possible locations.
77

8-
~~~~exercism/caution
8+
```exercism/caution
99
Binary search only works when a list has been sorted.
10-
~~~~
10+
```
1111

1212
The algorithm looks like this:
1313

14-
- Find the middle element of a *sorted* list and compare it with the item we're looking for.
14+
- Find the middle element of a _sorted_ list and compare it with the item we're looking for.
1515
- If the middle element is our item, then we're done!
1616
- If the middle element is greater than our item, we can eliminate that element and all the elements **after** it.
1717
- If the middle element is less than our item, we can eliminate that element and all the elements **before** it.

0 commit comments

Comments
 (0)