How to sort vector? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to sort vector?

How to sort vector of integers from the biggest to the smallest number in the quickest way? Or maybe there is such a function for an array?

31st Jan 2020, 10:03 PM
Юля Гудз
Юля Гудз - avatar
4 Answers
+ 3
first sort than reverse the array
31st Jan 2020, 10:17 PM
Oma Falk
Oma Falk - avatar
+ 3
Just get this yourarrayname Array.Sort<int>(yourarrayname); Array.Reverse(yourarrayname);
1st Feb 2020, 12:50 AM
Artemis Ariamehr
Artemis Ariamehr - avatar
+ 1
have a look at the algorithm header file. http://www.cplusplus.com/reference/algorithm/
31st Jan 2020, 10:20 PM
rodwynnejones
rodwynnejones - avatar
0
Just try more you imagine you will be closer to your goals or target
2nd Feb 2020, 10:31 AM
7amid A7med
7amid A7med - avatar