Update README.md

This commit is contained in:
marina 2023-08-07 23:01:42 -07:00 committed by GitHub
parent b6faf3956b
commit f2b423db58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@
* binary searching is composed of 3 sections: * binary searching is composed of 3 sections:
* **pre-processing**: sort if collection is unsorted * **pre-processing**: sort if collection is unsorted
* **binary search**: using a loop or recursion to divide search space in half after each comparison (`O(log(N)`) * **binary search**: using a loop or recursion to divide search space in half after each comparison (`O(log(N)`)
* **post-processing`: determine viable candidates in the remaining space * **post-processing**: determine viable candidates in the remaining space
* there are 3 "templates" when writing a binary search: * there are 3 "templates" when writing a binary search:
* `while left < right`, with `left = mid + 1` and `right = mid - 1` * `while left < right`, with `left = mid + 1` and `right = mid - 1`