Question: Use C++ programming language 1) Implement the Counting Sort algorithm using your favorite programming language. a) Upon running, your program should prompt the user for
1) Implement the Counting Sort algorithm using your favorite programming language. a) Upon running, your program should prompt the user for the input array size b) Then your program should generate an array of requested size and fill it with random integers between 1 and 100 (so in Counting sort your k-100, which means the 'C' array should have indices from 0 to 100) c) Print the generated random array d) Finally, print the sorted array. 2) Implement the Fractional Knapsack problem using your favorite programming language. pt the user for item weights. b) Then prompt the user for item values. c) Then prompt the user for the knapsack weight rating (W) d) Print each and every greedy choice. That is the items that are selected and how much of each
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
