Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago