Our Services

Get 15% Discount on your First Order

Dynamic Programming for partation and  backtracing  CSE 3318 Lab Assignment 3 Due March 27 Goal: 1. Understanding of dynamic programming. 2.

Dynamic Programming for partation and  backtracing

CSE 3318 Lab Assignment 3

Due March 27

Goal:

1. Understanding of dynamic programming.

2. Understanding of subset sums.

Requirements:

1. Design, code, and test a C program that uses dynamic programming to partition (if possible) a

sequence of n positive integers into three subsequences such that the sum of each subsequence is the
same. For example, if the input were (10, 20, 30, 40, 40, 50, 80), with a total of m = 270, the three
m/3 = 90 subsequences could be (10, 80), (20, 30, 40), and (40, 50). If the input were (20, 20, 30, 50),
then no solution is possible even though the values yield a sum (m = 120) divisible by 3 (m/3 = 40).

The input should be read from standard input (which will be one of 1. keyboard typing, 2. a shell

redirect (<) from a file, or 3. cut-and-paste. Do NOT prompt for a file name!). The first line of the
input is n, the length of the sequence. Each of the remaining lines will include one sequence value.

Your program should echo the input sequence in all cases. The dynamic programming table should be

output when m/3 < 10, but in no other cases. Error messages should be displayed if m is not divisible
by 3 or if the problem instance does not have a solution. When a solution exists, it should be
displayed with each subsequence in a separate column:

i 0 1 2
1 10
2 20
3 30
4 40
5 40
6 50
7 80

2. Submit your C program on Canvas by 3:45 p.m. on Wednesday, March 27. One of the comment lines

should include the compilation command used on OMEGA (5 point penalty for omitting this).
Another comment should indicate the asymptotic worst-case time in terms of m and n.

Getting Started:

1. If you wanted two sequences summing to m/2, then the backtrace part of subsetSum.c could easily

be modified. By finding one subsequence that sums to m/2, the remaining elements would be another
subsequence that sums to m/2. Similarly, your program should use dynamic programming to find two
subsequences that each sum to m/3 and then take the leftover values as the third subsequence. Thus,
this is a two-dimensional DP situation, not one-dimensional like ordinary subset sums in Notes 7.F.

2. Dynamic programming is the only acceptable method for doing this lab.

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Hello, I need assistance discussing the evolution of technology as outlined in my attachment. Can you assist me? The paper will deal with the

Hello, I need assistance discussing the evolution of technology as outlined in my attachment. Can you assist me? The paper will deal with the evolution of computer technology. Course Goal/Objective Describe how concepts such as RISC, pipelining, cache memory, and virtual memory have evolved over the past 25 years to

1- Read “Case 18.3: Wearable Technologies Supporting AI in Healthcare” and write an essay that answers the following questions: 1. What is

1- Read “Case 18.3: Wearable Technologies Supporting AI in Healthcare” and write an essay that answers the following questions: 1. What is wearable technology, and how has it evolved beyond its initial purpose of tracking athletic activities? 2. What are the different types of data that wearable technology can collect,

Discuss some hardening techniques or products you have used for Workstations

Discuss some hardening techniques or products you have used for Workstations

After the Executive Committee’s meeting, Peter Joseph, the President, and CEO of Container Manufacturing Solutions (CMS) was contented with the briefing

After the Executive Committee’s meeting, Peter Joseph, the President, and CEO of Container Manufacturing Solutions (CMS) was contented with the briefing that you made on how enterprise architecture can help the organization. Mr. Joseph is now interested in the risks involved in creating an EA. He wants you to prepare

Please write a reflection summary of what you have learned these past 16 weeks in the course “Physical Security” Also, tell me what things I did as an in

Please write a reflection summary of what you have learned these past 16 weeks in the course “Physical Security” Also, tell me what things I did as an instructor that were the most helpful to you, as well as any suggestions you have for further improving this course. Thank you, and I

Perform a LOPA (Layers of Protection Analysis) of your local living area or work location. Remember to get permission from security.

Perform a LOPA (Layers of Protection Analysis) of your local living area or work location. Remember to get permission from security.

4/18/24, 11:38 AM Assignment Information 1/3 IT 200 Project Two The IT Professional Guidelines and Rubric Competency In this project, you will

4/18/24, 11:38 AM Assignment Information 1/3 IT 200 Project Two The IT Professional Guidelines and Rubric Competency In this project, you will demonstrate your mastery of the following competency: Articulate the roles and functions of the information technology professional Scenario Whether you are just beginning your career in information technology

Lab Assignment #9 Confirmatory Factor Analysis using AMOS Goal of Exercise:  The goal of this exercise is to introduce how to operationalize the CFA

Lab Assignment #9 Confirmatory Factor Analysis using AMOS Goal of Exercise:  The goal of this exercise is to introduce how to operationalize the CFA using AMOS. The exercise allows students to learn how to check if the measurement model has acceptable levels of goodness-of-fit and evidence of construct validity.

Lab – Configure IPv6 Addresses on Network Devices Lab – Configure IPv6 Addresses on Network Devices Topology Addressing

Lab – Configure IPv6 Addresses on Network Devices Lab – Configure IPv6 Addresses on Network Devices Topology Addressing Table Device Interface IPv6 Address Prefix Length Default Gateway R1 G0/0/0 2001:db8:acad:a::1 64 N/A R1 G0/0/1 2001:db8:acad:1::1 64 N/A S1 VLAN 1 2001:db8:acad:1::b 64 N/A PC-A NIC 2001:db8:acad:1::3 64 fe80::1 PC-B NIC

Assignment 5 Due Saturday 11:59 pm (Week 12) Part 1 (40 points) This dataset contains State-by-state data on COVID-19 vaccinations in the United

Assignment 5 Due Saturday 11:59 pm (Week 12) Part 1 (40 points) This dataset contains State-by-state data on COVID-19 vaccinations in the United States from 1/2/2021 to 8/2/2021. You will be required to answer the following questions by timeseries analysis. * For vaccines that require multiple doses, each individual dose

,, I will upload more information about it to know better about the material Hi all, the instructions for the final project are attached. You are allowed to finish the project within 2 days at most. you can choose and tell me which option is easy and fast you

file attached Read “Case 14.3: AI at Airbnb” and write an essay that answers the following questions: 1. How has Airbnb’s

file attached Read “Case 14.3: AI at Airbnb” and write an essay that answers the following questions: 1. How has Airbnb’s business model transformed the travel industry? 2. How does Airbnb use sentiment analysis to improve its services? 3. How does text mining help Airbnb gain insights from guest reviews?

Prepare First, download and install CrypTool. If using a Windows® PC, install CrypTool 1.  If using a MAC PC, install JCrypTool. Note: In order for

Prepare First, download and install CrypTool. If using a Windows® PC, install CrypTool 1.  If using a MAC PC, install JCrypTool. Note: In order for the CrypTool program to function, you must first OPEN a text file. Only then will items on the toolbar become enabled. Additional information for this

Why is an update/patch process crucial for any organization to have and follow?  Discuss some issues that may arise when patching and updating

Why is an update/patch process crucial for any organization to have and follow?  Discuss some issues that may arise when patching and updating machines.

Tasks may not be submitted as cloud links, such as links to Google Docs, Google Slides, OneDrive, etc., unless specified in the task requirements. All other submissions must be file types that are uploaded and submitted as attachments (e.g., .docx, .pdf, .ppt). A.  Address ethical issues for cybersecurity by

The Cybersecurity Analyst’s Toolbox (Required/Graded) Discussion Topic During job interviews, employers often ask if you are

The Cybersecurity Analyst’s Toolbox (Required/Graded) Discussion Topic During job interviews, employers often ask if you are familiar with cybersecurity software. For this reason, it is a good idea to become familiar with commonly used software, including capabilities and limitations. These software products are the tools for conducting your day-to-day duties.

Explain the differences between desktop and laptop architecture.  What features are specific to laptops and laptop displays? Describe the evolution of

Explain the differences between desktop and laptop architecture.  What features are specific to laptops and laptop displays? Describe the evolution of laptops into other mobile devices.

I’m working on a WebApp platform React project. I have a small requiement that needs to be done. Enabling file upload option for a text field. I have

I’m working on a WebApp platform React project. I have a small requiement that needs to be done. Enabling file upload option for a text field. I have added a screenshot to understand the requirement better.