Algorithm for finding the smallest number of coins

Assignment Help Data Structure & Algorithms
Reference no: EM131417221

1. Consider the following coin changing problem. You are given a value N and an infinite supply of coins with values d1, d2, . . . , dk. Give an O(Nk) algorithm for finding the smallest number of coins that add up to the value N.

2. A subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements; e.g. "ace?' is a subsequence of "abcdef." Consider the problem of finding the longest common subsequence of two sequences - this is a task versioning systems like git or cvs often solve. Show that this is a special case of the sequence alignment problem. Then, give a polynomial-time algorithm for finding the longest subsequence common to three sequences. Analyze its running time and argue why it is correct.

3. String C is considered to be an interleaving of strings A and B if it contains all (and only) the characters of both A and of B and their respective order is preserved in C. For example, C = aacabbaa is an interleaving of A = aaba and B = caba (demonstrated as follows: aacabbaa). Give an algorithm that, given strings A, B, and C, decides whether C is an interleaving of A and B in polynomial time. Prove your answer correct.

4. What would it mean to add memoization to Strassen's matrix multiplication algorithm?

What asymptotic improvement (if any) does it yield in the worst case? Explain your answer.

Reference no: EM131417221

Questions Cloud

What confidence level would you assign to the procedure : What confidence level would you assign to the procedure in your example; that is, what percentage of the time do you think it produces your desired result?
Is a confidence interval appropriate for given situation : The university had information for all students showing that 3900 of the 5000 graduates were state residents. Is a confidence interval appropriate for this situation? If so, compute the appropriate interval. If not, explain why not.
Calculate the confidence interval : Suppose that we collect data on "hours of sleep last night" from 64 students who are present at an 11:00 A.M. statistics class.- Calculate the confidence interval.
Discuss five factors that led to further westward expansion : Before the American Revolution, England had prohibited colonists from migrating westward beyond the Appalachian Mountains. Explore this week's Webtext materials.Discuss five (5) factors that led to further westward expansion.
Algorithm for finding the smallest number of coins : Consider the following coin changing problem. You are given a value N and an infinite supply of coins with values d1, d2, . . . , dk. Give an O(Nk) algorithm for finding the smallest number of coins that add up to the value N
What are hr laws that organization can use to develop policy : What are some HR laws that organizations can use to develop and implement policies, procedures, and practices? Name and describe at least three laws that would drive policies, procedures, and practices.
What are the key points or facts presented in the article : Why is the author writing about the subject? What is the thesis of the article? What are the key points/facts presented in the article? What are the conclusions and recommendations?
Top three internet issues of today : Do research to identify the top three Internet issues of today. Write a paragraph on each issue and why it is considered significant.
Comment on the statisticians conclusion : An environmental group is suing a manufacturer because chemicals dumped into a nearby river may be harming fish.- Comment on the statistician's conclusion.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Q1 consider the hire assistant problem we interview n

q1 consider the hire assistant problem. we interview n candidates and always hire the best qualified so far. let n 5

  Question about shortest prefixes

A prefix of a string is a substring string at the beginning of the given string. The prefixes of "carbon" are: c, ca, car, carb, carbo and carbon.

  Telephone number as a string

Write a program that inputs a telephone number as a string in the form (555) 555-5555. The program should use an object of class StringTokenizer to extract the area code as a token, the first three digits of the phone number as a token and the las..

  Create a mind map with your defense in depth approach

Read the article "The Vulnerability of Nuclear Facilities to Cyber Attacks". Create a mind map or diagram with your defense in depth approach to securing a nuclear power plant. Use your text and open research on the Internet to assist in building ..

  Create an array that will store seven temperatures

Create an array that will store 7 temperatures. Populate the array with 7 random temperatures from 1 to 100 degrees. (hint use a for loop and a Random number Generator).

  Determine the value of the postfix expressions

Determine the value of the following prefix and postfix expressions. (↑ is exponentiation.) +, -, ↑, 3, 2, ↑, 2, 3, /, 6, -4, 2

  Describe the worst case scenario for quick sort algorithm.

Any ideas to improve the worst case? Comment on the improvement in running time vs. increase in code complexity.

  Create a emp table with empno

1.Create a emp table with empno, ename,job,sal  And solve the following query

  Java program to make choice for a coffee cup size

Create an application that prompts the user to make a choice for a Coffee cup size, S for Small, T for Tall, G for Grande and V for Venti the rates of cup sizes will be stored in a parallel double array as $2, $2.50, $3.25, and $4.50 respectively.

  Give algorithm-correctness proof-time complexity for tree

Determine the minimum number of nodes in tree to remove so that the tree is separated into subtrees of sizes at most k. Give the algorithm, the correctness proof and the time complexity.

  Design a relational database so that it is at least in 3nf

Explain typical situations when denormalizing a table is acceptable. Provide one (1) example of denormalizing a database table to justify your response. Explain the significant manner in which business rules impact both database normalization and..

  What are some of the critical differences

When you start a new project, what are the essential tasks you take care or start with?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd