trekhleb / javascript-algorithms

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

adding readme file explaining cocktailshakersort adding cocktailshake… #1119

Open mohmmadAyesh opened 3 months ago

mohmmadAyesh commented 3 months ago

Hi I added CocktailShakerSort Algorithm its like Bubble Sort Algorithm but it can be bidirectional in some cases it can achieve better than BubbleSort with less time Complexity on average and worst case its O(n^2) on best case its O(n) it take constant amount from Memory so its memory complexity is O(1) I Wrote A java script file for it following your pattern in writing these algorithm like extending class from Sort,etc Also make a test file CocktailShake.test.js to test it Also I added a Readme file that explaining it with references for further information Please Accept my PR.

mohmmadAyesh commented 3 months ago

@trekhleb is that PR awaiting review or just I need to fix this test to pass please help thanks