Question Description
you have to do all the steps – it is 4 part homework and you need to do it all and submit each part in different file and name it as what part it is.
Part one:
Greedy algorithms: The principle of a greedy algorithm is to find a near best solution for local conditions. For instance, a cashier gives coin changes to a customer, the best way is to give the smallest number of coins to the customer. However, it is usually hard to make such an arrangement. The cashier usually gives the largest valued coins first until could not give more, then select the second largest valued coins to the customer. And so on so forth.
For instance, for 48 cents, the cashier usually give one "25c", two "10c", and three"1c" coins. This algorithm is called the cashier's algorithm that is a greedy algorithm. According to the previous research, the cashier's algorithm is already the optimum for the US coin change system. Meaning that the cashier's algorithm will give the best solution for US coin changes.
If a coin system is randomly assigned, for instance, there is no "5c"–nickel. The cashier's algorithm may not reach the optimum in some cases.
(1) Design the cashier's algorithm for any coin-change systems. You can assume the single coin values up to 10 different coins (m<=10). You can assume that the changes are in between 1-99 cents (1<=n<=99). (2) What is the time complexity with respect to "m" and "n?"
(2) Write a C++ or Java program to implement the cashier's algorithm. (You can just use the US coin changes as the example.)
(3) Write an essay about the greedy algorithm ( 2 pages).
Part two:
Write a program using Dynamic Programming for combination number
C(n,m) = n!/m!(n-m)! = C(n-1,m)+C(n-1,m-1)
Part three:
Basic Graphs
(1) Establish a graph: Using both the adjacency matrix and the adjacency-list to represent 10 cities in U.S. based on airline travels (for edges and their distance). (2) According to geometric locations of the cities, draw a map for this graph. (Hint: using Java/Python would be easier. If you use C++, you might need to use OpenGL)
Part four:
Implement the DFS or BFS algorithm for component identification.
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Place Order” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.