javascript-algorithms
javascript-algorithms copied to clipboard
Optimize Bubble Sort with early-stop check.
This pull request improves the existing Bubble Sort algorithm by adding an early-stop optimization. If no elements are swapped during a pass, the function exits early, reducing unnecessary iterations. Includes example usage for clarity.
LLMs at home be like