starting on readme

This commit is contained in:
Francis Yang 2024-01-09 05:46:00 -08:00
parent 0e42ab86e6
commit e59f1ed1fc
3 changed files with 15 additions and 1 deletions

View File

@ -124,9 +124,9 @@ a set of rules that precisely define a sequence of operations.
* **Searches**
* `B` [Linear Search](src/algorithms/search/linear-search)
* `B` [Jump Search](src/algorithms/search/jump-search) (or Block Search) - search in sorted array
* `B` [Twin Pointers](src/algorithms/search/twin-pointers) - search sorted array
* `B` [Binary Search](src/algorithms/search/binary-search) - search in sorted array
* `B` [Interpolation Search](src/algorithms/search/interpolation-search) - search in uniformly distributed sorted array
* `B` [Twin Pointers](src/algorithms/search/twin-pointers)
* **Sorting**
* `B` [Bubble Sort](src/algorithms/sorting/bubble-sort)
* `B` [Selection Sort](src/algorithms/sorting/selection-sort)

View File

@ -0,0 +1,14 @@
# Twin Pointers
The twin pointers method, also known as the two pointers method, is a searching algorithm that can be used on both
![Binary Search](https://upload.wikimedia.org/wikipedia/commons/8/83/Binary_Search_Depiction.svg)
## Complexity
**Time Complexity**: `O(n)` - since we only need to look over every element of our array a single time when comparing, time complexity is O(n).
## References
- [Wikipedia](https://en.wikipedia.org/wiki/Binary_search_algorithm)
- [YouTube](https://www.youtube.com/watch?v=P3YID7liBug&index=29&list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8)