8000 Renamed array · Gengpp/swift-algorithm-club@f664af1 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit f664af1

Browse files
committed
Renamed array
1 parent 467503c commit f664af1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Count Occurrences/README.markdown

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ The trick is to use two binary searches, one to find where the `3`s start (the l
2222
In code this looks as follows:
2323

2424
```swift
25-
func countOccurrences<T: Comparable>(of key: T 8000 , in a: [T]) -> Int {
25+
func countOccurrences<T: Comparable>(of key: T, in array: [T]) -> Int {
2626
var leftBoundary: Int {
2727
var low = 0
28-
var high = a.count
28+
var high = array.count
2929
while low < high {
3030
let midIndex = low + (high - low)/2
3131
if a[midIndex] < key {
@@ -39,7 +39,7 @@ func countOccurrences<T: Comparable>(of key: T, in a: [T]) -> Int {
3939

4040
var rightBoundary: Int {
4141
var low = 0
42-
var high = a.count
42+
var high = array.count
4343
while low < high {
4444
let midIndex = low + (high - low)/2
4545
if a[midIndex] > key {

0 commit comments

Comments
 (0)
0