Skip to content

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