Question
1) Rod cutting problem: A cutting factory buys long steel rods and then and cuts them into shorter rods, which it then sells. Each cut
1) Rod cutting problem: A cutting factory buys long steel rods and then and cuts them into shorter rods, which it then sells. Each cut is free. The selling price is based on the length of the cut. The factory want to determine the best cuts in order to maximize its revenue. Below, the price that the factory can make for each length of rod is given. Determine the maximum revenue, rn, obtainable by cutting up the rod and selling the pieces using bottom-up dynamic-programming approach.
Length, I | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
Price, pi | 2 | 4 | 5 | 6 | 9 | 10 | 12 |
2) How can we check whether the directed-graph contains a cycle using the DFS algorithm? Explain each step in detail.
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