Question: In a warehouse, a manager would like to sort the items in the stock. Given an array of n item values, sort the array in

In a warehouse, a manager would like to sort the items in the stock. Given an array of n item values, sort the array in ascending order, first by the number of items with a certain value, then by the values themselves. Example n = 6 items = [4, 5, 6, 5, 4, 3] There are 2 values that occur twice: [4, 4, 5, 5]. There are 2 values that occur once: [3, 6]. The array of items sorted by quantity and then by value in ascending order is [3, 6, 4, 4, 5, 5] Function Description Complete the function itemsSort in the editor below. itemsSort has the following parameter(s): int items[n]: an array of integers to sort Returns: int[n]: An array of integers sorted as described. Constraints 1 n 2 105 1 items[i] 106 Input Format for Custom Testing Sample Case 0 Sample Input 0 STDIN Function ----- -------- 5 items[] size n = 5 3 items = [3, 1, 2, 2, 4] 1 2 2 4 Sample Output 0 1 3 4 2 2 Explanation There is a quantity of 2 for the item 2 : [2, 2] There is a quantity of 1 for the items 1, 3 and 4 : [1], [3], [4] The array of items sorted by quantity and then by value in ascending order is [ 1, 3, 4, 2, 2]

need codeing out put C#

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!