Skip to content

Commit

Permalink
Merge pull request teivah#8 from yuanworks/patch-1
Browse files Browse the repository at this point in the history
Uniform variable names (hi and lo) on code snippet
  • Loading branch information
teivah authored Feb 5, 2020
2 parents 91bd930 + 3d606cc commit ff9ae8b
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 ff9ae8b

Please sign in to comment.