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

removed using namespace std; and fixed indentation #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

removed using namespace std; and fixed indentation #80

wants to merge 1 commit into from

Conversation

nobleknightt
Copy link

As suggested by @sergio-nsk in this[https://github.com//pull/70] issue, removed using namespace std; and fixed indentation.

if (i < j) {
int tmp = arr[i];
arr[i] = arr[j];
arr[j] = tmp;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why don't use std::swap ?

}
int tmp = arr[low];
arr[low] = arr[j];
arr[j] = tmp;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why don't use std::swap?


int arr[n];
cout<<"Enter array elements "<<endl;
int arr[n];
Copy link
Contributor

Choose a reason for hiding this comment

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

Variable length arrays are not of the C++ standard and are GCC extension only. std::vector<int> should be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants