Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Cocktail shaker algorithm in c++ #357

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

viraj200524
Copy link

Before opening a Pull Request, please read the following items:

  1. Make sure you have read the CONTRIBUTING guidelines
  2. Make sure no other PR is implementing the same change
  3. Make sure the Continuous Integration workflows (Github Actions) are all passing
  4. If in doubt about how to approach another contributor, read our CODE OF CONDUCT guidelines

Description

This C++ program implements the Cocktail Shaker Sort algorithm, a variation of Bubble Sort. It sorts a list of integers by traversing through the array in both directions—left-to-right and right-to-left—allowing it to quickly place unsorted elements into their correct positions. The algorithm continues alternating between these passes until no more swaps are needed, indicating that the array is sorted. This approach is particularly efficient for nearly sorted lists. The main function demonstrates sorting a sample array and outputs the sorted result.
Please add appropiate hacktoberFest 2024 tags
Thank you

Copy link
Owner

@kelvins kelvins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add the link to the README file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants