c++ sort
int arr[]= {2,3,5,6,1,2,3,6,10,100,200,0,-10};
int n = sizeof(arr)/sizeof(int);
sort(arr,arr+n);
for(int i: arr)
{
cout << i << " ";
}
c++ sort
int arr[]= {2,3,5,6,1,2,3,6,10,100,200,0,-10};
int n = sizeof(arr)/sizeof(int);
sort(arr,arr+n);
for(int i: arr)
{
cout << i << " ";
}
sort vector c++
// C++ program to sort a vector in non-decreasing
// order.
#include <bits/stdc++.h> // Vector
#include <algorithm> // Sort
using namespace std;
int main()
{
// Initalizing the vector v with these values
vector<int> v{ 1, 5, 8, 9, 6, 7, 3, 4, 2, 0 };
// Vector is sorted in ascending order
sort(v.begin(), v.end());
return 0;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us