Skip to content

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