Digital structures problem.please you C++ coding language!! Please and thank you!!

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Digital structures problem.please you C++ coding language!! Please and thank you!!

Post by answerhappygod »

Digital structures problem.please you C++ coding language!!
Please and thank you!!
Digital Structures Problem Please You C Coding Language Please And Thank You 1
Digital Structures Problem Please You C Coding Language Please And Thank You 1 (124.74 KiB) Viewed 36 times
Given an array of integers, create a 2-dimensional array where the first element is a distinct value from the array and the second element is that value's frequency within the array. Sort the resulting array descending by frequency. If multiple values have the same frequency, they should be sorted ascending. Example arr = [3, 3, 1, 2, 11 • There are two values, 3 and 1, each with a frequency of 2, and one value 2 with a frequency of 1: [[3, 2), (1, 2), (2, 1] • Sort the 2-dimensional array descending by frequency: [[3,2), [1, 2], [2. 11] • Sort the 2-dimensional array ascending by value for values with matching frequencies: [[1,2), (3, 2), (2, 1)] Function Description Complete the function groupSort in the editor below. groupSort has the following parameter(s): int arr[n). an array of integers Returns: int[n][2): a 2-d array of integers sorted as described
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply