Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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,
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);
In C Language, not C++
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started