Question 14282 – Graphs-and-Tree
November 13, 2023Question 3426 – Higher-Education-and-Politics
November 13, 2023Question 14228 – Algorithms
Define Rn< >to be the maximum amount earned by cutting a rod of length n metres into one or more pieces of integer length and selling them. For i > 0, let p[i] denote the selling price of a rod whose length is i meters. Consider the array of prices:
p[1] = 1, p[2] = 5, p[3] = 8, p[4] = 9, p[5] = 10, p[6] = 17, p[7] = 18
Which of the following statements is/are correct about R7?
Correct Answer: B
Question 18 Explanation:
The rod length of R7 is 18.
![](https://solutionsadda.in/wp-content/uploads/2021/03/Screenshot_43.png)
There are 3 different possible ways to get the maximum amount.
P[6] + P[1] → 17+1 = 18
P[2] + P[2] + P[3] → 5+5+8 = 18
P[7] → 18 = 18
![](https://solutionsadda.in/wp-content/uploads/2021/03/Screenshot_43.png)
There are 3 different possible ways to get the maximum amount.
P[6] + P[1] → 17+1 = 18
P[2] + P[2] + P[3] → 5+5+8 = 18
P[7] → 18 = 18
R7is achieved by three different solutions.
R7=18
R7=19
R7cannot be achieved by a solution consisting of three pieces.
Subscribe
Login
0 Comments