-
Notifications
You must be signed in to change notification settings - Fork 497
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 quicksort C implementation #16
Conversation
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.
Commenting can be done in the function part and label can be given to variables for their usages
quicksort/quicksort.c
Outdated
int main(){ | ||
int ar_size = 4, i; | ||
int a[4]; | ||
a[0] = 2; a[1] = 3; a[2] = 0; a[3] = 4; |
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.
Maybe simply
int a[4] = {2, 3, 0, 4};
@singhpratyush this code looks good. I am closing my review. |
There are still some corrections to be done. @aviaryan : Please take a look at all the comments. |
ecef7cb
to
c475d65
Compare
# Conflicts: # README.md
@singhpratyush Please review and squash merge this PR. |
quicksort/quicksort.c
Outdated
} | ||
} | ||
|
||
int main(){ |
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.
There should be a space after )
.
quicksort/quicksort.c
Outdated
if ((prevind>-1) && (ar[i] < prevmax)){ | ||
temp = ar[i]; | ||
ar[i] = prevmax; | ||
ar[ prevind ] = 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.
Please make spaces in index consistent.
quicksort/quicksort.c
Outdated
#include "stdio.h" | ||
|
||
|
||
void quicksort(int ar_size, int * ar) { |
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.
Remove extra space.
Will merge locally because of conflicts |
@singhpratyush There are no conflicts. |
All set. Thanks. |
# This is the 1st commit message: # This is a combination of 5 commits. # This is the 1st commit message: changes # This is the commit message iiitv#2: changes # This is the commit message iiitv#3: changes # This is the commit message iiitv#4: changes # This is the commit message iiitv#5: changes # This is the commit message iiitv#2: Added Coin Change Problem [JavaScript] (iiitv#317) * Added CoinChangeProblem [JavaScript] * undo changes in other files * Travis fix 1.0 * Travix fix v1.1 * Update comments # This is the commit message iiitv#3: fixed readme conflicts # This is the commit message iiitv#4: conflicts # This is the commit message iiitv#5: changes # This is the commit message iiitv#6: changes # This is the commit message iiitv#7: conflicts # This is the commit message iiitv#8: changes # This is the commit message iiitv#9: changes # This is the commit message iiitv#10: changes # This is the commit message iiitv#11: conflicts # This is the commit message iiitv#12: conflicts # This is the commit message iiitv#13: conflicts # This is the commit message iiitv#14: conflicts # This is the commit message iiitv#15: conflicts # This is the commit message iiitv#16: Added Longest Common Subsequence [Python] (iiitv#353) * Added Longest Common Subsequence [Python] Fixes iiitv#340 * changes * travis issues # This is the commit message iiitv#17: Added Counting Sort [Go] (iiitv#361) * Added Shell Sort [Javascript] * Added Shell Sort [Javascript] * Auto stash before rebase of "origin/master" Fix spaces * Added param comment * Renamed * Fixed temp declaration * Added Counting Sort [Go] * Time complexity corrected * size
Fixes #2