Time complexity of sort function in c++ overloaded with compare function
Answers
Answered by
0
Answer:
#include <algorithm>
#include <iostream>
#include <string>
int main()
{
int arr[5];
arr[0] = 2;
arr[1] = 3;
arr[2] = 5;
arr[3] = 1;
arr[4] = 4;
std::sort(arr,arr+5);
std::cout<<arr[0]<<"\n";
std::cout<<arr[1]<<"\n";
std::cout<<arr[2]<<"\n";
std::cout<<arr[3]<<"\n";
std::cout<<arr[4]<<std::endl;
return 0;
}
Explanation:
Similar questions