-
Notifications
You must be signed in to change notification settings - Fork 0
Class7algorithms #8
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
base: gh-pages
Are you sure you want to change the base?
Conversation
reneemeyer
left a comment
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.
Renata, good job on your JS methodology, I can kind of see where you're coming from, however I would like to see some more comments in your code, with these types of functions other developers are going to need a road map to understand what's going on. Please put in at least 5 comments describing your code and turn bubbleSort into a recursive function. Thanks!
| var temp = arr[j-1]; | ||
| arr[j-1] = arr[j]; | ||
| arr[j] = temp; | ||
| } |
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.
Renata, I see where your going here, however, I would like for you to avoid using two loops and use a recursive function instead.
| right =arr.slice(mid); | ||
| //send left and right to the mergeSort to broke it down into pieces | ||
| //then merge those | ||
| return merge(mergeSort(left),mergeSort(right)); |
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.
very nice
| function mergeSort(arr) { | ||
| // Your code here | ||
| function merge(left, right){ | ||
| var result = [], |
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.
don't use var
Checkpoint Rubric
This is the rubric that your instructor will use to grade your checkpoints. Please do not edit.
Checkpoint 1
Checkpoint 2
Checkpoint 3