Skip to content

Implementation Edit to Bubble Sort in Javascript #292

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

Merged
merged 4 commits into from
Aug 27, 2018
Merged

Implementation Edit to Bubble Sort in Javascript #292

merged 4 commits into from
Aug 27, 2018

Conversation

Wesley-Arrington
Copy link
Contributor

Added main() to code so that it can be run as is

- Added main()
- bubbleSort() now returns the sorted array
@Gathros Gathros added the Implementation Edit This provides an edit to an algorithm implementation. (Code and maybe md files are edited.) label Jul 22, 2018
Copy link
Contributor

@Butt4cak3 Butt4cak3 left a comment

Choose a reason for hiding this comment

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

Well... Same thing as in your bogo sort PR.

@@ -8,4 +8,12 @@ function bubbleSort(arr) {
}
}
}
return arr;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same thing as in the bogo sort edit. You don't actually have to return the array.


function main() {
var testArray = [4,5,123,759,-132,8940,24,34,-5]
print(bubbleSort(testArray));
Copy link
Contributor

Choose a reason for hiding this comment

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

No print in JavaScript. Use console.log and split it up into two lines.

bubbleSort(testArray);
console.log(testArray);

}

function main() {
var testArray = [4,5,123,759,-132,8940,24,34,-5]
Copy link
Contributor

Choose a reason for hiding this comment

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

JS files should be indented with 2 spaces and use const for non-chaning variables (and let for mutable ones). var is pretty much legacy at this point. Also, there should be spaces after the commas in the array initialization ([1, 2, 3] instead of [1,2,3]).

Copy link
Contributor

Choose a reason for hiding this comment

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

Wow. I didn't catch that. GitHub renders the indentation inside main two spaces wide.

@june128
Copy link
Member

june128 commented Aug 3, 2018

Same with this one, changes seemed to have happened. How's it looking? @Butt4cak3 @Gustorn

@PudottaPommin
Copy link
Member

Now it's good.

@zsparal
Copy link
Contributor

zsparal commented Aug 9, 2018

Yeah, looks good to me. @Butt4cak3 we need you to approve it

@jiegillet jiegillet dismissed Butt4cak3’s stale review August 27, 2018 00:50

Changes were made as requested, Butt4cak3 is away

Copy link
Member

@jiegillet jiegillet left a comment

Choose a reason for hiding this comment

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

I'm told this os good to go, thank you!

@jiegillet jiegillet merged commit 6fa1761 into algorithm-archivists:master Aug 27, 2018
@Wesley-Arrington Wesley-Arrington deleted the javascriptBubble branch September 10, 2018 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementation Edit This provides an edit to an algorithm implementation. (Code and maybe md files are edited.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants