Skip to content
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

selection_sort.c: Add Selection Sort in C #163

Merged
merged 1 commit into from
Oct 17, 2018

Conversation

123vivekr
Copy link
Member

@123vivekr 123vivekr commented Oct 2, 2018

This adds Selection Sort algorithm written in C

For short term contributors: we understand that getting your commits well
defined like we require is a hard task and takes some learning. If you
look to help without wanting to contribute long term there's no need
for you to learn this. Just drop us a message and we'll take care of brushing
up your stuff for merge!

Closes #145

By submitting this pull request I confirm I've read and complied with the
below declarations.

  • I have read the Contribution guidelines and I am confident that my PR reflects them.
  • I have followed the commit guidelines for this project.
  • My code follows the standard code structure.
  • This pull request has a descriptive title. For example, {Tag}: Add {Algorithm/DS name} [{Language}], not Update README.md or Added new code.
  • This pull request will be closed if I fail to update it even once in a continuous time span of 7 days.
  • This pull request shall only be reviewed and merged once all the checks passes. No maintainer or supporter shall be obliged to review it before this condition is met.
  • I have mentioned the issue number correctly (with hyperlink) in this pull request description.

After you submit your pull request, DO NOT click the 'Update Branch' button.

void print_array(int[], int);

int main() {
int arr[] = {4,3,42,82,5,2,33};
Copy link
Member

Choose a reason for hiding this comment

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

Missing space after , [whitespace/comma] [3]

Origin: CPPLintBear, Section: all.cpp.

}

/* Selection Sort algorithm */
void selection_sort(int arr[], int n){
Copy link
Member

Choose a reason for hiding this comment

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

Missing space before { [whitespace/braces] [5]

Origin: CPPLintBear, Section: all.cpp.

void print_array(int[], int);

int main() {
int arr[] = {4,3,42,82,5,2,33};
Copy link
Member

Choose a reason for hiding this comment

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

Missing space after , [whitespace/comma] [3]

Origin: CPPLintBear, Section: all.cpp.

}

/* Selection Sort algorithm */
void selection_sort(int arr[], int n){
Copy link
Member

Choose a reason for hiding this comment

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

Missing space before { [whitespace/braces] [5]

Origin: CPPLintBear, Section: all.cpp.

@123vivekr 123vivekr force-pushed the c/selection_sort branch 2 times, most recently from 2a5e03a to fbf85e8 Compare October 2, 2018 13:19
selection_sort/C/selection_sort.c Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@sangamcse
Copy link
Member

Comment on 011c195, file queue/cpp/Queue.h, line 0.

No #ifndef header guard found, suggested CPP variable is: QUEUE_CPP_QUEUE_H_ [build/header_guard] [5]

Origin: CPPLintBear, Section: all.cpp.

@sangamcse
Copy link
Member

Comment on 011c195, file queue/cpp/Queue.h, line 8.

private: should be indented +1 space inside class Queue [whitespace/indent] [3]

Origin: CPPLintBear, Section: all.cpp.

@sangamcse
Copy link
Member

Comment on 011c195, file queue/cpp/Queue.h, line 10.

public: should be indented +1 space inside class Queue [whitespace/indent] [3]

Origin: CPPLintBear, Section: all.cpp.

@123vivekr 123vivekr force-pushed the c/selection_sort branch 3 times, most recently from 60d1164 to ca428b6 Compare October 5, 2018 18:45
@sangamcse sangamcse mentioned this pull request Oct 5, 2018
7 tasks
@123vivekr
Copy link
Member Author

@sangamcse Requested changes have been made. Please take a look :)

@123vivekr 123vivekr force-pushed the c/selection_sort branch 2 times, most recently from f8706fd to 112d502 Compare October 14, 2018 12:52
README.md Outdated
| [Heap Sort](https://en.wikipedia.org/wiki/Heapsort) | | | | [:octocat:](heap_sort/python) |
| [Maximum Subarray Problem](https://en.wikipedia.org/wiki/Maximum_subarray_problem) | | | | [:octocat:](/maximum_subarray/Python)|
| [Knapsack Problem](https://en.wikipedia.org/wiki/Knapsack_problem) | | | | [:octocat:](knapsack_problem/Python)|

| [Shell Sort](https://en.wikipedia.org/wiki/Shellsort) | | | | [:octocat:](shell_sort/Python) |
Copy link
Member

Choose a reason for hiding this comment

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

I know this one conflicting your PR but this needs to be as it is. I merged your last PR knowing that it will be a little tough because of practice. But at this time, you need to understand this git-flow. Rebase your master branch from upstream/master. And then rebase this branch with your local master. I think that should work. Try once.

README.md Outdated
@@ -21,10 +21,12 @@ This repository contains examples of various algorithms written on different pro
| [Binary Search](https://en.wikipedia.org/wiki/Binary_search_algorithm) | | [:octocat:](binary_search/Cpp) | | [:octocat:](binary_search/Python) |
| [Bubble Sort](https://en.wikipedia.org/wiki/Bubble_sort) | [:octocat:](bubble_sort/C) | [:octocat:](bubble_sort/Cpp) | [:octocat:](bubble_sort/Java) | |
| [Shell Sort](https://en.wikipedia.org/wiki/Shellsort) | [:octocat:](shell_sort/C) | | | [:octocat:](shell_sort/Python) |
| [Bubble Sort](https://en.wikipedia.org/wiki/Bubble_sort) | [:octocat:](bubble_sort/C) | [:octocat:](bubble_sort/Cpp) | | |
Copy link
Member

Choose a reason for hiding this comment

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

Whats the reason of adding this line along with the unneccessary change of line 28? Can you cross check your changes in README?

This adds Selection Sort algorithm written in C

Closes NITSkmOS#145
@sangamcse
Copy link
Member

ack 435f884

@sangamcse
Copy link
Member

@sangamcse rebase

@sangamcse
Copy link
Member

Hey! I'm GitMate.io! This pull request is being rebased automatically. Please DO NOT push while rebase is in progress or your changes would be lost permanently ⚠️

@sangamcse
Copy link
Member

Automated rebase with GitMate.io was successful! 🎉

@sangamcse sangamcse merged commit 1c5a6c4 into NITSkmOS:master Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Algo] Selection Sort [C]
2 participants