Skip to content

Commit

Permalink
Uniform variable names (hi and lo) on code snippet
Browse files Browse the repository at this point in the history
`high` and `low` are meant to be `hi` and `lo`
  • Loading branch information
yuanworks authored Feb 5, 2020
1 parent 91bd930 commit d13227a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions array.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Delete: O(n)
int lo = 0, hi = a.length - 1;

while (lo <= hi) {
int mid = low + ((high - low) / 2);
int mid = lo + ((hi - lo) / 2);
if (a[mid] == key) {
return mid;
}
Expand Down Expand Up @@ -197,4 +197,4 @@ Time complexity: O(n)

Memory complexity: O(1)

[#array](array.md)
[#array](array.md)

0 comments on commit d13227a

Please sign in to comment.