Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Algorithm Please answer right, and circle the final answer. Thanks All cardinali

ID: 3837191 • Letter: A

Question


Algorithm
Please answer right, and circle the final answer.
Thanks

All cardinality 19. In the Republic of Snoldova, coins are minted in three deno the stark, the snookie, and the snoodle. A snookie is worth 5 snarks, and a le is worth 7 snarks. algorithm for making N snarks in change using the fewest possible total number o coins coin repeatedly selecting and adding to the current denominati collection ge the largest whose value does not exceed the amount remaining to be made. Does this algorithm correctly solve of change of is "No" the problem for the Snoldovian system coinage? Show that the answer for by giving, in the box below, an example of a integer N for which this greedy algorithm positive snoodles, making change in the amount N snarks from kies, and would NOT which used the fewest possible total number of coins. give an answer snarks Counterexample N 20. Consider the character sequence Using the Huffman code from this by the method presented in lecture, how many bits would be required

Explanation / Answer

This algorithm fails for N = 10.

The minimal number of coins required here 1 Snookie and 1 Snoodle. With greedy approach, we wil get 1 Snoodle and 3 Snarks.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote