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

Added CocktailSort.js #130

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nilesh-05
Copy link

Made CocktailSort.js in JavaScript folder

@diptangsu
Copy link
Owner

Please change it to 4 space indents.

@nilesh-05
Copy link
Author

Please check

isSwapped = false;
for (let i = startIndex; i < endIndex - 1; i++) {
if (arrInput[i] > arrInput[i + 1]) {
let temp = arrInput[i];
Copy link
Owner

Choose a reason for hiding this comment

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

Fix indentation

return arrInput;
}
//Cocktail Sort is a variatio of bubble sort.
//Example Usage :
Copy link
Owner

Choose a reason for hiding this comment

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

add the example as actual code

Copy link
Author

Choose a reason for hiding this comment

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

You mean all the function code at one level of indentation?

Copy link
Owner

Choose a reason for hiding this comment

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

ofcourse not. please use some formatter or something and fix the indentation.

}
startIndex++;
}
return arrInput;
Copy link
Owner

Choose a reason for hiding this comment

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

indent the entire function code with 4 spaces

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