given an array of lets say 30 items, make a function that prints the highest n values, in this case 10. Do this without sorting, and do it with the fastest algorithm.     int topn = 10;     int array_size = 30;     int a[] = {2, 3, 5, 6, 1, 2, 3, 5, 7, 4, 23, 123, 54, 64, 123, 21, 54, 34, 76, 45, 87, 98, 34, 234, 12, 43, 54, 23, 12, 43};     // function top_n(a, array_size , topn);

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 17RQ
icon
Related questions
Question

given an array of lets say 30 items, make a function that prints the highest n values, in this case 10. Do this without sorting, and do it with the fastest algorithm.

    int topn = 10;

    int array_size = 30;

    int a[] = {2, 3, 5, 6, 1, 2, 3, 5, 7, 4, 23, 123, 54, 64, 123, 21, 54, 34, 76, 45, 87, 98, 34, 234, 12, 43, 54, 23, 12, 43};

    // function top_n(a, array_size , topn);

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning