mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-14 06:52:59 +08:00
starting on readme
This commit is contained in:
parent
0e42ab86e6
commit
e59f1ed1fc
@ -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)
|
||||
|
14
src/algorithms/search/twin-pointers/README.md
Normal file
14
src/algorithms/search/twin-pointers/README.md
Normal 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)
|
0
src/algorithms/search/twin-pointers/twinPointers.js
Normal file
0
src/algorithms/search/twin-pointers/twinPointers.js
Normal file
Loading…
Reference in New Issue
Block a user