Question

1. Minimization and Maximization Problems Which of the following best describes the role of the greedy...

1. Minimization and Maximization Problems

Which of the following best describes the role of the greedy approach in minimization (min) and maximization (max) optimization problems?

A) The greedy approach never works for min or max problems

B) The greedy approach never works for min problems but may work for max problems

C) The greedy approach never works for max problems but may work for min problems

D) The greedy approach may work for min and max problems

E) The greedy approach always works for min problems and may work for max problems

F) The greedy approach always works for max problems and may work for min problems

G) The greedy approach always works for min and max problems

2. Greedy Algorithm Examples

Which algorithms use the greedy strategy?

Multiple answers:You can select more than one option

A) Median-of-Medians with Quick Select

B) Prim's Minimum Spanning Tree algorithm

C) Kruskal's Minimum Spanning Tree algorithm

D) Cocktail-Shaker Sort

E) Huffman Coding

F) Dijkstra's Single-Source-Shortest-Path algorithm

3. Coin Change Problem

Which function should be used to determine how many coins of denomination d should be used to make change for the remaining value v, assuming that the higher denominations of coins have already been tried and exhausted?

A) v - d (subtraction)

B) v x d (multiplication)

C) v / d (fractional division)

D) v // d (integer division)

E) v % d (modulo)

F) v ^ d (exponentiation)

4. Coin Change Algorithm - Time Complexity

Which best describes the worst case time complexity of the Coin Change Algorithm as originally implemented and after the suggested improvement? Let n be the amount for which we are trying to make change, and let d be the number of denominations of coins.

A) O(n^d) staying at O(n^d)

B) O(n^d) reducing to O(n)

C) O(n^d) reducing to O(d)

D) O(n x d) staying at O(n x d)

E) O(n x d) reducing to O(n)

F) O(n x d) reducing to O(d)

G) O(n / d) staying at O(n / d)

H) O(n / d) increasing to O(n)

I) O(n / d) increasing to O(d)

Please, include a short explanation with the answer.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1) Minimization and Maximization Problems-
D) The greedy approach may work for min and max problems
This is because sometimes greedy approach works and when it fails dynamic programming is used for optimization.

2) Greedy Algorithm Examples-
B) Prim's Minimum Spanning Tree algorithm
C) Kruskal's Minimum Spanning Tree algorithm
D) Cocktail-Shaker Sort
E) Huffman Coding
F) Dijkstra's Single-Source-Shortest-Path algorithm

A) Median-of-Medians with Quick Select is a divide and conquer algorithm.

3) Coin Change Problem-
D) v // d (integer division)​​​​​​​ must be used to find the no. of coins of denomination d that should be used to make change for the remaining value v.

4) Coin Change Algorithm - Time Complexity-
D) O(n x d) staying at O(n x d)​​​​​​​ achived using dynamic programming.


​​​​​​​IF the answer helped then please upvote, it means a lot.
And for any queries feel free to comment.

Add a comment
Know the answer?
Add Answer to:
1. Minimization and Maximization Problems Which of the following best describes the role of the greedy...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • ANAL UP ALUUm FINAL PART1 ouesnoN13 which ot the following is QUESTION14. Which of the following...

    ANAL UP ALUUm FINAL PART1 ouesnoN13 which ot the following is QUESTION14. Which of the following is not in P? E. Max Cut D. Minimum Spanning Tree C. Min Cut B. 2-SAT Linear Programming QUESTION15. How many NP problems did Karp include in his tree hierarchy? E. 31 D. 22 A. 1 QUESTION16. Which of the following is not one of Karp's original NP problems? C. Feedback Arc Set D. Feedback N Set E. Partition B. Node Cover Arc Cover...

  • Your program must meet the following specifications: 1. At program start, assume a stock of 10 nickels, 10 dimes, 10...

    Your program must meet the following specifications: 1. At program start, assume a stock of 10 nickels, 10 dimes, 10 quarters, and 10 pennies. 2. Repeatedly prompt the user for a price in the form xX.xx, where X denotes a digit, or to enter q' to quit 3. When a price is entered a. If the price entered is negative, print an error message and start over requesting either a new price or to quit (indicated by entering a 'q)...

  • C++ HW Question Your program will simulate a simple change maker for a vending machine. It...

    C++ HW Question Your program will simulate a simple change maker for a vending machine. It will start with a stock of coins and dollars. It will then repeatedly request the price for an item to be purchased or to quit. If given a price, it will accept nickels, dimes, quarters, one-dollar and five-dollar bills—deposited one at a time—in payment. When the user has deposited enough to cover the cost of the item, the program will calculate the coins to...

  • ODE - 1 Q.1 Solve the following first order linear initial value problems. (a) 2ndp -...

    ODE - 1 Q.1 Solve the following first order linear initial value problems. (a) 2ndp - 0.4pdt -0, p(1)- 0.2 (b) v(f) dv (1) +*dt - 0, v(2) -2 + 2v ()- 6, v(0) - 10 (c) (d) The first order differential equation, initial value problem, - Sms, v(0) = 2ms. describes the motion of a car. Find an expression for the speed v () and determine the velocity of the car after 10 seconds from the beginning of its...

  • Multiple choice questions 1. Which of the following correctly describes the difference between paired and independent...

    Multiple choice questions 1. Which of the following correctly describes the difference between paired and independent sample data? A) Independent samples operate based on a known o, whereas paired samples may operate with a sample standard deviation. B) Independent samples are used to address the difference between two separate populations, whereas paired samples involve a matched analysis. C) Independent samples incorporate at distribution, whereas paired samples may use the z distribution for approximation. D) Independent samples always have the same...

  • Answer the following multiple choice questions: 1. Market prices are:                 a. irrelevant to rational choice...

    Answer the following multiple choice questions: 1. Market prices are:                 a. irrelevant to rational choice                 b. an indication of how scarce items are.                 c. all money prices divided by themselves.                 d. only important to retailers. 2. What is considered “rational” by one persona may not be “rational” to another person because:                 a. of ethical considerations that give rise to different value judgments.                 b. people have different preferences                 c. of the effects on the...

  • Question 1 For each of the following sub-questions, select the best answer. Each correct answer is...

    Question 1 For each of the following sub-questions, select the best answer. Each correct answer is worth two marks. 1. Neither Chile nor Peru has a mass-market café culture, but this fact has not stopped Starbucks from trying to determine what can be done to make its coffee houses successful in those markets. By recognizing that people in these two South American countries do not drink coffee as people in the United States do and that it needs to change...

  • Multiple-Choice Questions (worth two points each) 1. Which of the following describes the process in which...

    Multiple-Choice Questions (worth two points each) 1. Which of the following describes the process in which one adopts patterns of behavior that lead to greater life satisfaction? A. wellness B. health C. social determination D. self-efficacy 2. The Stages of Change Model of health behavior change emphasizes that A. change happens as a process. B. people change only when faced with an illness. C. change occurs only when the environment supports it. D. changes are more effective when based on...

  • What is the role of polymorphism? Question options: Polymorphism allows a programmer to manipulate objects that...

    What is the role of polymorphism? Question options: Polymorphism allows a programmer to manipulate objects that share a set of tasks, even though the tasks are executed in different ways. Polymorphism allows a programmer to use a subclass object in place of a superclass object. Polymorphism allows a subclass to override a superclass method by providing a completely new implementation. Polymorphism allows a subclass to extend a superclass method by performing the superclass task plus some additional work. Assume that...

  • Question 1 1 pts What is the kinetic energy of a man who weighs 980N who...

    Question 1 1 pts What is the kinetic energy of a man who weighs 980N who is riding in a car traveling 40 km per hour? Express your answer in Joules, but don't type the unit in the answer box. Round to the nearest whole number. (Careful with the units) 1 pts Astudent slides her 80.0-kg desk across the level floor of her dormitory room a distance 4.00 m at constant speed. If the coefficient of kinetic friction between the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT