trekhleb / javascript-algorithms

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings
MIT License
184.96k stars 29.83k forks source link

Twin Pointer Method #1096

Open Fy50167 opened 5 months ago

Fy50167 commented 5 months ago

Adding a section for the twin pointer method under the search algorithms section. The code section features two different exported functions (one for sorted, one for unsorted) instead of one single default export which I'm not sure is allowed but I figured I would try to include both since the usage of the algorithm differs slightly in the two cases. Both functions are tested via jest.