Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write programs for the following exercises in Java, Python, C#, or C++. Each file should have your name at the top in comment,

1. Write programs for the following exercises in Java, Python, C#, or C++. Each file should have your name at the top in comment, with short description of the implemented class and for files with main method the problem it is solving. Make sure your files have appropriate names. Note 1: If a program is not in approved programming language (or in different language than previous assignment) or has any syntax error, no points will be awarded for that exercise Note 2: Submitting wrong files or in the wrong format or corrupted files will not be accepted nor will any re-submission be allowed for any such mistake. a) BackKnapsack: Implement the backtracking algorithm for Knapsack problem from your textbook (Algorithm 5.7) and modify to output the max profit and the item numbers that give the solution. Code the below problem instance in your main method. Document the solution. W=12 i 1 20 2 2 30 5 3 35 7 4 12 3 5 3 1 b) BoundKnapsack: Implement the Branch-And-Bound algorithm using best-first search traversal for Knapsack problem from your textbook (Algorithm 6.2) and modify to output the max profit and the item numbers that give the solution. Code the same problem instance as previous problem (a) in your main method. Document the solution. c) CompareKnapsack: Modify and run (a) and (b) algorithms using a large instance of the problem (15-20 items) and compare performance (based on the number of nodes examined). Document the instance used, solution (list of items), number of nodes examined, and discussion of the performance differences and conclusions. 2. Record a video 10-12min long explaining the implementation and output of each of the above programs 3. Submission instructions: Submit one zip file with all the programs; second zip file with documented solutions for the first three programs (a-c), and solution and analysis for the last one (d); and third zip file with the video

Step by Step Solution

3.58 Rating (144 Votes )

There are 3 Steps involved in it

Step: 1

Commenting Commenting involves placing Descriptions inside of computer programs detailing what the C... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

General Chemistry

Authors: Darrell Ebbing, Steven D. Gammon

9th edition

978-0618857487, 618857486, 143904399X , 978-1439043998

More Books

Students also viewed these Accounting questions

Question

Write Lewis symbols for the following: a. P b. P3 c. Ga d. Ga3+

Answered: 1 week ago