Skip to content

Commit 467503c

Browse files
authored
Update README.markdown
1 parent 8a7db67 commit 467503c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Count Occurrences/README.markdown

+1-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ func countOccurrences<T: Comparable>(of key: T, in a: [T]) -> Int {
5555
}
5656
```
5757

58-
Notice that the variables `leftBoundary` and `rightBoundary` are very similar to the [binary search](../Binary%20Search/) algorithm. The big difference is that they don't stop when they find the search key, but keep going. Also, notice that we constrain the type `T` to be Comparable so that the algorithm can be applied to an
59-
60-
y of Strings, Ints or other types that conform to the Swift Comparable protocol.
58+
Notice that the variables `leftBoundary` and `rightBoundary` are very similar to the [binary search](../Binary%20Search/) algorithm. The big difference is that they don't stop when they find the search key, but keep going. Also, notice that we constrain the type `T` to be Comparable so that the algorithm can be applied to an array of Strings, Ints or other types that conform to the Swift Comparable protocol.
6159

6260
To test this algorithm, copy the code to a playground and then do:
6361

0 commit comments

Comments
 (0)