8 HOURS DELIVERY: PLAGIARISM FREE AND QUALITY WORK GUARANTEED.

Step-by-step Guides to reach Dynamic Programming Solution The following are ste

Step-by-step Guides to reach Dynamic Programming Solution
The following are step-by-step guides to finish this lab. Answer all questions in red in this document, and modify/extend the code as instructed. In the end, submit this document on Blackboard, and the coin_change.cpp on autograder.
Compile and run the starter code first, and understand the solutions given for UnlimitedCoinChange( ).
To investigate whether dynamic programming can be used to improve its performance, we check if it has two characteristics: overlapping optimal substructure and overlapping subproblems. (Ref: CLR textbook, see the RodCuttingExplained reading posted on the weekly schedule page).
* Optimal substructure refers to the fact that (optimal) solutions to a problem incorporate (optimal) solutions to related subproblems, which we may solve independently. Another way to put it is that the problem has a recursive solution.
Can you write a formula for the mv, which denotes the minimum number of coins required to make value v with the given set of coins? If v cannot be expressed with the set of coins, mv is infinite.
* Overlapping subproblem: Add cout statement to the function, to display a line such as the following whenever the function is called:
UnlimitedCoinChange (value=14) called
Compile and run your program, and note all instances where UnlimitedCoinChange is called to solve a problem multiple times (a.k.a., overlapping subproblems) below:
What are the overlapping subproblems you found?
2. To avoid recomputing overlapping subproblems, we will use a table to store subproblem solutions.
Analyze the UnlimitedCoinChange( ) function, as an algorithm, what are its input and output? Which input parameter(s) are not changed, and which input parameters are varying during the recursive calls?
int UnlimitedCoinChange (const vector & coins, int value)
b. Design the table to use following the guideline:
The table used by dynamic programming provides a lookup: given a subproblem’s input, it tells us the subproblem’s solution.
We typically use array or vector, where the index is the subproblem’s input, and the value of the array/vector element is the subproblem solution.
vector subProblemSolutions; //subProblemSolutions[i] tells us the minimum number of coins that we can make value=i with; if a certain value cannot be expressed with the coins, its entry should be set to INT_MAX
Draw the subProblemSolution table used for UnlimitedCoinChange(…, value=31,..) below. Show the size of the table, what’s stored in the table entry. Note that you don’t need to fill in the table’s entries, just illustrate using an example or two.
vector coins{3, 5, 6, 10};
3. Tabulation version:
Write a new function, unlimitedCoinChange_Tabulation() that solves the problem using the tabulation approach. The following is the pseudocode:
//Return the minimum number of coins we need to use to make the given @value, assuming there are unlimited supplies for each type of coins given by @coins.
int UnlimitedCoinChange_Tabulation (const vector & coins, int value)
{
//1. Declare the table (see step 2 above)
//2. Based upon the base cases from UnlimitedCoinChange, fill out the initial entries of the table
//3. Write a for loop to solve all problems, from smallest (1) to largest (value)
For (int cur_v=2; cur_v<=value; cur_v++)
{ // solve subproblem cur_v, and store the solution in the table
//Note: use the optimal substructure found in step 1
}
//4. Return solution stored in table for @value
}
4. Develop a Memoization approach following the instruction below
Write a wrapper function, in which we declare and initialize the table, and then call the recursive function
Int UnlimitedCoinChange_Wrapper (const & coins, int value)
{
//1. Declare and initialize all entries to -1, meaning all problems are not yet solved
//2. Call memoized recursive solution, and return what’s returned by the function
}
Extend UnlimitedCoinChange to the following memoized version:
int UnlimitedCoinChange_Memoized (const vector & coins, int value, vector & subProblemSolutions)
Note that to memoized a recursive function, do the following:
At the entry to the function, check the table to see the current problem has been solved before or not. If so, return the table entry; if not, proceed.
At the exit point of the function (i.e., before each return statement), stores the result in the table.
5. How are the optimal solutions achieved?
Now, consider how to extend dynamic programming solutions above so that we not only report a) The minimum number of coins required, but also b) the coins used to make a given value.
a). In pure recursive solution given, this is done by taking best subproblem solution and append to it the branch that leads to the subproblem (the i-th coin)
//General case of UnlimitedCoinChange
int curMin = INT_MAX; //we don't have a solution yet
//used to save “current subproblem solution”
vector curBest;
int curSol;
for (int i=0;i coins{3, 5, 6, 10};
1). Only draw two levels of the tree (root node, and its child nodes).
2). Label what’s returned by each child node (both the int value, and the value of curBest vector)
Note: you don’t need to trace each recursive call to the base case.
3). Follow logic of the above general case, to find out what’s returned by the root.
4). Mark which branch of the root node yields the best solution
b).(Extra Credit) In Dynamic Programming, we just store the current option (the branch in the decision tree) taken at each subproblem in a second table:
vector subProblemSolution; //as before
vector firstCoinUsed; //which branch (as in recursion solution) leads to optimal solution?
The second table provides a lookup: for a value to make it maps to the first coin to use (that leads to an optimal solution eventually) in the decision tree.
Based upon your work in step a) above, show the content of subProblemCoinUsed[31], I.e., what’s the first coin to use in the decision tree that leads to optimal solution?
c). (Extra Credit) Extend your memorized solution so that the subProblemCoinUsed table is used to store all “first coin” used.
int UnlimitedCoinChange_WrapperExtended (const & coins, int value)
{
//1. Declare and initialize both tables: all entries to -1, meaning all problems are not yet solved
//2. Call memoized recursive solution, and return what’s returned by the function
//3. Use the firstCoinUsed table to output all coins used
}
int UnlimitedCoinChange_MemoizedExtended (const vector & coins, int value, vector & subProblemSolutions, vector & firstCoinUsed)

Learning Goal: I’m working on a c++ report and need support to help me learn.Des

Learning Goal: I’m working on a c++ report and need support to help me learn.Description 1Control statements in C++• With the help control statements (branching / looping), write a C++ program, algorithm and draw a flowchart to find the factorial of n integer number entered by a user. 2Tow dimensional array• To write a C++ program to create M and N matrices & perform a multiplicationoperation. The answer need to be stored in a variable W3Familiarizing with stringoperations & functions• With the help of function write a C++ program to arrange 5 names entered by a user in descending order. 4Familiarizing with Matlab• Use matlab / octave software to solve the given equation Y=5(x)+3• plot x & y• label the axis • enable the grid• give a title as (plotting y=5(x)+3
Requirements: good enough   |   .doc file

Learning Goal: I’m working on a c++ question and need an explanation and answer

Learning Goal: I’m working on a c++ question and need an explanation and answer to help me learn.Project Two Guidelines and RubricCompetencyIn this project, you will demonstrate your mastery of the following competency:Develop code using algorithms and data structures to solve basic programming problems
ScenarioThe academic advisors in the Computer Science department at ABCU are very happy with the planning and design you have completed for the advising assistance software. They have decided they would like you to move forward with writing the code for the application so the department advisors can start using this to help when they talk with students.DirectionsAll of your coding will be completed in the integrated development environment (IDE). Additional references on the use of this IDE are linked in the Supporting Materials section. As you begin coding, you will be using the data structure that you recommended in Project One to complete the following.Input: Design code to correctly read the course data file. The program you will submit will be a command-line program written in C++. You will prompt the user to ask for the file name that contains the course data and read that file into course objects that are stored in your chosen data structure. Your data structure will hold course objects.
Menu: Design code to create a menu that prompts a user for menu options. The menu should include the following options:Load Data Structure: Load the file data into the data structure. Note that before you can print the course information or the sorted list of courses, you must load the data into the data structure.
Print Course List: This will print an alphanumeric list of all the courses in the Computer Science department.
Print Course: This will print the course title and the prerequisites for any individual course.
Exit: This will exit you out of the program.
Loading Data Structure: Develop working code to load data from the file into the data structure.
Course List: Develop working code to sort and print out a list of the courses in the Computer Science program in alphanumeric order (including all math courses). To print out a course list, use the pseudocode you created previously to guide your work. Then, create code that will allow advisers to print a course list in alphanumeric order. Remember that this code should do the following:Sort the course information alphanumerically from lowest to highest.
Print the sorted list to a display.
Course Information: Develop working code to print course information. This code should allow users to look up a course and print out information about its title and prerequisites. Your program will need to prompt the user to enter the courseNumber. You will then print out the name of the course along with the prerequisite courseNumbers and titles. See Project Two Sample Program Output in the Supporting Documents section.
Industry Standard Best Practices: Apply industry standard best practices in code design. Your program should display an error message when user input does not fall within parameters. You should also use in-line comments and appropriate naming conventions to enhance readability and maintainability.
What to SubmitTo complete this project, you must submit the following:Advising Assistance ProgramSubmit all of your C++ code that is needed to implement the project in a single ZIP file. Make sure the code compiles and runs.Supporting MaterialsThe following resources may help support your work on the project:Course InformationThis document outlines the courses and pathway you will be designing for.ABCU Advising Program InputThis file contains all of the course information you will need to run your program. The text is written in comma-separated values for the fields that include course number, course title, and prerequisites. The course number and title will be on every line in the file, but a course may have 0, 1, or more prerequisites. A prerequisite will be listed with its course number.Project Two Sample Program OutputThis file shows an example of the kind of output you would expect from the program you are designing.Project Two RubricCriteriaExemplary (100%)Proficient (85%)Needs Improvement (55%)Not Evident (0%)ValueInputExceeds proficiency in an exceptionally clear, insightful, sophisticated, or creative mannerDesigns code to correctly read a data fileShows progress toward proficiency, but with errors or omissions; areas for improvement may include taking care of missing filesDoes not attempt criterion15MenuExceeds proficiency in an exceptionally clear, insightful, sophisticated, or creative mannerCreates a menu that prompts a user for appropriate inputShows progress toward proficiency, but with errors or omissions; areas for improvement may include ensuring the output matches exactly what is provided in the sampleDoes not attempt criterion15Loading Data StructureExceeds proficiency in an exceptionally clear, insightful, sophisticated, or creative mannerDevelops code to load file data into the data structureShows progress toward proficiency, but with errors or omissions; areas for improvement may include displaying the prerequisites correctly or functioning correctly with multiple input filesDoes not attempt criterion20Course ListExceeds proficiency in an exceptionally clear, insightful, sophisticated, or creative mannerDevelops the appropriate algorithm to print out a sorted list of data from a data structureShows progress toward proficiency, but with errors or omissions; areas for improvement may include properly sorting the list of coursesDoes not attempt criterion20Course InformationExceeds proficiency in an exceptionally clear, insightful, sophisticated, or creative mannerDevelops the appropriate algorithm that looks up a course using an appropriate data structureShows progress toward proficiency, but with errors or omissions; areas for improvement may include properly displaying the course informationDoes not attempt criterion20Industry Standard Best PracticesExceeds proficiency in an exceptionally clear, insightful, sophisticated, or creative mannerApplies industry standard best practices in code designShows progress toward proficiency, but with errors or omissions; areas for improvement may include adding more comments, naming all variables by convention, or displaying an error message when user input does not fall within parametersDoes not attempt criterion10Total:100%Requirements: n/a | .doc file | C++
Requirements: 1500

Learning Goal: I’m working on a c++ multi-part question and need an explanation

Learning Goal: I’m working on a c++ multi-part question and need an explanation and answer to help me learn.In C++, need help with the following. I have my rough skeleton of code for reference. Cannot change Main.cpp – please don’t change it. Otherwise, please feel free to change or alter my current code. The graph class should have the following data elements:Head A pointer to the first node in the linked list of nodes
Current A pointer to the current node
N Number of nodes in graph
The graph class should have the following functions:Constructor Initialize the empty graph
Destructor Delete the node list
Insert
Insert an edge into the graph. Takes three parameters, a value for the
source node, a value for the target node, and the weight of the edge.
If either of the values do not exist, add them to the node list.
Show Display the the current node
Depth Display the values of a depth-first search. Takes one parameter, the output stream.
Breadth Display the values of a breadth-first search. Takes one parameter, the output stream.
Move Move the Current pointer to the matching node in the list. Takes one parameter, a string.
Put
Output the value, and the values and distances to its immediate
neighbors. Takes one parameter, the output stream.
Connect
Create a new edge and attach it to the end of the edge list. Takes two
parameters, a pointer to the target node, and the distance.
Breadth Add this node’s neighbors to a breadth-first list of nodes. This does not need to be recursive.
The node class should have the following data elements:Value Stored value (a string)
Visit Boolean indicator shows if node has been visited
Edges A pointer to the first edge node in the linked list of edges
Next A pointer to the next node in the linked list of nodes
The node class should have the following functions:Constructor Create an empty node
Destructor Delete the edge list
Depth Recursive depth-first search.
The edge class should have the following data elements:Target A pointer to the target node
Weight Distance to the target node
Next The next edge in the list
The edge class should have the following functions:Constructor Create an edge with a pointer to a node and the distance
Destructor Delete any following edges
All
data elements should be private. It will help to declare the graph
class a friend to the node class. Your class should also contain
functions to move around the graph, search depth-first, and
breadth-first. Edge.h#ifndef EDGE_H#define EDGE_Hclass node;class edge{ friend class node; ///declare node as a friend of the class edgepublic: edge(node* argt, int argw); // Constructor for edges – needs both target and weight ~edge(); //destructor for edgesprivate: int weight; // Weight – distance to the target node node* target; // Pointer to the target node node* next; //to the next edge in the list };#endifEdge.cpp#include #include #include using namespace std;#include “Edge.h”/*************************************** Constructor**************************************/edge::edge(node* argt, int argw){target = argt;weight = argw;next = NULL;}Graph.h#ifndef GRAPH_H#define GRAPH_H#include “Edge.h”//#define NODE_MAX 8class graph{public: graph(); // Constructor ~graph(); // Destructor bool graph::insert(string arg_source, string arg_target, int argw); // Insert edge into graph //bool link(string args, string argt, float argw); // Add link void show(ostream& out); //show the current node void move(string val); // moves the current pointer to the matching node in list void depth(ostream&); //Displays the values of a depth first search void breadth(ostream&); // Displays the values of a breadth searchprivate: node* head; // pointer to the first node in linked list of nodes node* current; //pointer to the current node int N; //number of nodes in the graph};#endifGraph.cpp#include #include #include using namespace std;#include “Graph.h”#include “Node.h”/******************************* Null constructor******************************/graph::graph(){//constructor for graph – starts off emptyhead = NULL;current = NULL;N = 0;}/******************************* Null deconstrutctor******************************/graph::~graph(){//null destructor for graph//counter integerif (head != NULL){ delete head;}}/************************************** * insert() **************************************/bool graph::insert(string arg_source, string arg_target, int argw){//insert edge into graph//value for source node, value for target, and weight of edge//temporary pointernode* p = head;//check if p is not null firstwhile (p != NULL && p.){}}/*************************************** show()**************************************/void graph::show(ostream& out){//insert edge into graph//value for source node, value for target, and weight of edge using put functioncurrent->put(out);}/*************************************** move()**************************************/void graph::move(string val){//insert edge into graph//value for source node, value for target, and weight of edge}/*************************************** depth()**************************************/void graph::depth(ostream& out) {node* p = head;while (p != NULL){ p->visit = false;}//move to the start node with move function//return back to head//call depth on starting node in the list//// If visited == true, return – we have visited each and every node//if (visit == true)//{// return;//}//// Set visited = true once all nodes have been visited//visit = true;//// Output this node’s contents. //cout << get_value() <depth().//int i = 0; //counter variable//while ((i depth(cout);// i++;//}}/*************************************** breadth()**************************************/void graph::breadth(ostream& out){//loop through each node in map//set map visited to false//set visited to false – temporary pointer qnode* q = head;while (q!= NULL){ q->visit = false;}//move back to start node(head) using move function//add edge[START] to the display list//set edge[START].visited to false//loop through each item – call show to output display//by calling display[i].breadth()}Node.h // Node Declarations#ifndef NODE_H#define NODE_H//include the edge class#include “Graph.h”//#include “Edge.h”#define ERR -1//#define NODE_MAX 20#define EDGE_MAX 20// Node classclass node{ friend class graph; //friend class edge;public: node(); //null constructor ~node(); // public ~node() deconstructor void set_value(string); // Set string value string get_value(); // Return string value void connect(node*); // Create a new edge and attach it to the end of the edge list //- takes pointer node and distance void put(ostream&); // Outputs the value and values/distances to immediate neighbors void depth(ostream&); // Depth-first search- recusrive void breadth(ostream&); // Add current node’s neighbors to a breadth first list of nodesprivate: string value; // Node value node* edge[EDGE_MAX]; // pointer to the first edge node in linked list of edges node* next; // pointer to the next node in the linked list of nodes bool visit; //boolean indicator – shows if node has been visited};typedef node* node_ptr;#endifNode.cpp#include #include #include using namespace std;#include “Node.h”/******************************* Null constructor******************************/node::node(){int i;value = “”;for (i = 0; i < N; i++){ edge[i] = NULL;}visit = false;next = NULL;}/******************************* Null destructor******************************/node::~node(){// if the node list is present, delete and clean up at endif (next != NULL){ delete next;}}/******************************* set_value()******************************/void node::set_value(string arg){value = arg;}/******************************* get_value()******************************/string node::get_value(){return value;}/******************************* connect()******************************/void node::connect(node* otherNodes)//function to connect one node to another{//number of edges, existing index, and existing nodeint numberOfEdges, existingIndex, existingNode;numberOfEdges = 0;existingIndex = 0;existingNode = 0;//counter variableint i = 0;cout << "Now connecting " <get_value() << " to " << get_value() << endl;//search for the position which is empty in edge array of the node – search all elements of array edgebool found;found = false;//search through all while the edge is not nullwhile (edge[i] != NULL){ if (edge[i] == otherNodes) { //if existing node is found, set index to i found = true; existingIndex = i; } //incrmeent by i i++;}//set number of edges equal to inumberOfEdges = i;if (!found){ //if not found, the number of edges will be equal to the edges shared by the other node edge[numberOfEdges] = otherNodes;}else{ //if found, set the value of the edge for that index in array //equal to the value of the edge for that index in the existing index edge[numberOfEdges] = edge[existingIndex];}}/******************************* put()******************************/void node::put(ostream&)//output function-displays the node's value followed by values of node's immediate neighbors{//counter integerint i = 0;//print statementcout << get_value() << endl;//need to put in while loop to print all edges of the node until NULLwhile (edge[i] != NULL){ cout << "—" <get_value() << endl; i++;}}/******************************* depth()******************************/void node::depth(ostream&)//function to print the traversal depth of a graph as we visit from node to node//with connecting edges{// If visited == true, return – we have visited each and every nodeif (visit == true){ return;}// Set visited = true once all nodes have been visitedvisit = true;// Output this node's contents. cout << get_value() <depth().int i = 0; //counter variablewhile ((i depth(cout); i++;}}/******************************* breadth()******************************/void node::breadth(ostream&)//function to print the traversal depth of a graph as we visit from node to node//with connecting edges{//loop through each edge first//counter variable iint i = 0;while ((i breadth(cout); //increment by one i++; //set the current target visted to true visit = true; }}//// If visited == true, return – we have visited each and every node//if (visit != true)//{// //add trget to display list//}//// Set visited = true once all nodes have been visited//visit = true;//// Output this node’s contents. //cout << get_value() <depth().//int i = 0; //counter variable//while ((i breadth(cout);// i++;//}}Main.cpp:#include #include #include using namespace std;#include “Graph.h”/***************************** main()****************************/void main(){ int dist; string fname,s,t; char method; fstream in; graph g;// Open file cout <> fname;//fname = “Program07a.txt”; in.open(fname.data(),ios::in);// Load file while(!in.eof()) { in >> s >> t >> dist; if(in.good()) g.insert(s,t,dist); };// Close file in.close();// Loop to display graph method = 0; while(method!=’Q’) {// Display cout << endl; g.show(cout);// Menu cout <> s; method = toupper(s[0]); cout << endl;// Move if(method=='M') { cout <> s; g.move(s); };// Searches if(method==’D’) g.depth(cout); if(method==’B’) g.breadth(cout); };// Done cout << "Thank you!" << endl;} Sample Text:A B 10A D 5A E 10D C 4D F 4C B 8C F 3F C 2F E 8 Sample Output:Enter file name: Program07a.txtNode AEdge B 10Edge D 5Edge E 10M)ove, D)epth, B)readth, P)ath, Q)uit: DDepth List—————-A B D C F ENode AEdge B 10Edge D 5Edge E 10 M)ove, D)epth, B)readth, P)ath, Q)uit: MEnter node: CNode CEdge B 8Edge F 3M)ove, D)epth, B)readth, P)ath, Q)uit: BBreadth List—————-C B F ENode CEdge B 8Edge F 3M)ove, D)epth, B)readth, P)ath, Q)uit: QThank you!
Requirements: As long as need be