-
Notifications
You must be signed in to change notification settings - Fork 166
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
base: master
Are you sure you want to change the base?
Conversation
Please change it to 4 space indents. |
Please check |
JavaScript/CocktailSort.js
Outdated
isSwapped = false; | ||
for (let i = startIndex; i < endIndex - 1; i++) { | ||
if (arrInput[i] > arrInput[i + 1]) { | ||
let temp = arrInput[i]; |
There was a problem hiding this comment.
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 : |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
JavaScript/CocktailSort.js
Outdated
} | ||
startIndex++; | ||
} | ||
return arrInput; |
There was a problem hiding this comment.
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
Made CocktailSort.js in JavaScript folder