Question
1. Suppose that you have the following kind of items: blueberries, raspberries, and blackberries. The weights of the three berries are 10 grams, 20 grams,
1. Suppose that you have the following kind of items: blueberries, raspberries, and blackberries. The weights of the three berries are 10 grams, 20 grams, and 12 grams, respectively. The cost per berry is 20 cents, 110 cents, and 60 cents. Suppose that you want to fill a 96 gram cup with berries such that you have the highest cost. Use a greedy method to solve the problem. Do you get the highest cost? Why or why not?
2. Suppose that you have a collection of compounds numbers 1 through 7. They have volumes W= {5, 20, 30, 10, 50, 35, 80} and costs C = {200, 400, 900, 60, 1000, 700, 2000}. You must fill a jar with volume 3500 with the most costly combination of chemicals. How does the greedy algorithm solve this problem?
3. There are a set of tasks that have the following start ad finish times. Use the greedy algorithm to find the minimum number of machines needed to perform the tasks. How are the tasks distributed among the machines. T = { (1, 10), (10, 18), (26, 32), (15, 19), (24, 20), (3, 12), (20, 25), (9, 28) }
4. Suppose you have the phrase "a black cat has a nasty smile on its face"
Please answer these questions asap
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