Question: How would I create a java class using Vectors that takes in a Vector v and integer n that: returns the largest n numbers of

How would I create a java class using Vectors that takes in a Vector v and integer n that:

returns the largest n numbers of the Vector v.

For example: Vector v = {1, 6, 3, 5}

int n = 2

The result would be 6, 5.

Thank you.

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!