Use selection-sort to sort first k elements of a list in ascending order and the remaining n-k elements in descending order.
Answers
Answered by
0
Arranging the array's elements from largest to smallest is termed as sorting the array in descending order. First, sort the array usingArray.Sort() method which sorts an array ascending order then, reverse it usingArray.Reverse() method. int [] arr = new int [] {1, 9, 6, 7, 5, 9}; // Sort array in ascending order.
Similar questions
Biology,
6 months ago
English,
6 months ago
Math,
6 months ago
Environmental Sciences,
11 months ago
Environmental Sciences,
1 year ago
CBSE BOARD X,
1 year ago