Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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

Use C++ programming language image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions