diff --git a/guide/english/miscellaneous/freecodecamp-algorithm-binary-search-guide/index.md b/guide/english/miscellaneous/freecodecamp-algorithm-binary-search-guide/index.md index 5bfe21f9bd..f1a9b660e5 100644 --- a/guide/english/miscellaneous/freecodecamp-algorithm-binary-search-guide/index.md +++ b/guide/english/miscellaneous/freecodecamp-algorithm-binary-search-guide/index.md @@ -15,7 +15,7 @@ Binary search works on sorted arrays. A binary search begins by comparing the mi The pseudocode for binary search algorithm is as follows: - BinarySearch(A0..N-1], value) { + BinarySearch(A[0..N-1], value) { low = 0 high = N - 1 while (low <= high) { @@ -55,7 +55,9 @@ The pseudocode for binary search algorithm is as follows: return -1; } -:rocket: [Run Code ## Python Implementation +![:rocket:](https://forum.freecodecamp.com/images/emoji/emoji_one/rocket.png?v=3 ":rocket:") Run Code + +## Python Implementation def binary_search(l, value): low = 0 @@ -67,4 +69,4 @@ The pseudocode for binary search algorithm is as follows: else: return mid return -1 -![:rocket:](https://forum.freecodecamp.com/images/emoji/emoji_one/rocket.png?v=3 ":rocket:") Run Code \ No newline at end of file +![:rocket:](https://forum.freecodecamp.com/images/emoji/emoji_one/rocket.png?v=3 ":rocket:") Run Code