-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Detailed Description
Add a program of sorting using inbuilt c++ sort function
Context
- More will get to know about the comparator function.
- How comparator function sort in lexical order and how to improve it.
Possible Implementation
bool compare(string a, string b)
{
cout << "Comparing " << a << " and " << b << endl;
if (a.length() == b.length())
return a < b;
return a.length() < b.length();
}
sort(arr, arr + n, compare);
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request