-
Notifications
You must be signed in to change notification settings - Fork 0
Week4a Algorithm #7
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.
Craig, nice job, all tests passed, just one question below :)
| for (let i = 0; i< ary.length; i++){ | ||
| if (ary[i] > ary[i + 1]) { | ||
| flip = true; | ||
| // using the swap without temp algorithm! Ex: ary[i] = 10, ary[i+1] = 6 |
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.
nice! I like this check
| let leftSide = ary.slice(0, middle); | ||
| let rightSide = ary.slice(middle); | ||
|
|
||
| return merge(mergeSort(leftSide), mergeSort(rightSide)); |
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.
nice and simple, why did you use let and and not const?
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.
Renee, I changed "let" vars to const where applicable. Made changes in both mergeSort and binarySearch (not in bubbleSort as my commit msg indicates :))
Algorithm Assignment. Build the following: