1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
FromTheMoon [43]
3 years ago
10

Choose a problem that lends to an implementation that uses dynamic programming. Clearly state the problem and then provide high-

level pseudocode for the algorithm. Explain why this algorithm can benefit from dynamic programming. Try to choose an algorithm different from any already posted by one of your classmates.
Computers and Technology
1 answer:
Svetradugi [14.3K]3 years ago
8 0

Answer:

Explanation:

The maximum weighted independent collection of vertices in a linear chain graph is a straightforward algorithm whereby dynamic programming comes in handy.

Provided a linear chain graph G = (V, E, W), where V is a collection of vertices, E is a set of edges margins, and W is a weight feature function applied to each verex.  Our goal is to find an independent collection of vertices in a linear chain graph with the highest total weight of vertices in that set.

We'll use dynamic programming to do this, with L[k] being the full weighted independent collection of vertices spanning from vertex 1 \to vertex k.

If we add vertex k+1 at vertex k+1, we cannot include vertex k, and thus L[k+1] would either be equivalent to L[k] when vertex k+1 is not being used, or L[k+1] = L[k-1] + W[k+1] when vertex k+1 is included.

Thus, L[k+1] = max \{ L[k], \ L[k-1] + W[k+1] \}

As a result, the dynamic programming algorithm technique can be applied in the following way.

ALGO(V, W, n) // V is a linearly ordered series of n vertices with such a weight feature W

\text{1. L[0] = 0, L[1] = W[1], L[2] = max{W[1], W[2]} //Base cases} \\ \\ \text{2. For i = 3 to n:- \\} \\ \\\text{3........ if ( L[i-1] > L[i-2] + W[ i ] )} \\ \\ \text{4............Then L[ i ] = L[i-1]} \\ \\ \text{5.........else} \\ \\ \text{6................L[i] = L[i-2] + W[i] }\\ \\ \text{7. Return L[n] //our answer.}

As a result, using dynamic programming, we can resolve the problem in O(n) only.

This is an example of a time-saving dynamic programming application.

You might be interested in
A computer with 5 stage pipeline like the one descrive in class delas with conditional branches by stalling for the next three c
trasher [3.6K]

Answer:

It hurts 80%

Explanation:

7 0
3 years ago
What is the main purpose of adding captions to an image or table in Word?
Wittaler [7]

Answer: c

Explanation:

7 0
3 years ago
A.)navigate
Vaselesa [24]

Answer:

start with what you know

Explanation:

you can learn a lot from it

7 0
3 years ago
________ is a markup language that allows for tagging selected elements of the content of documents for their meanings and is us
trasher [3.6K]

Answer:

E)nXML

Explanation:

XML is a short for Extensible Markup Language. It is a markup language like the Hypertext markup language (HTML) and are both used in the development of web applications. However while the HTML describes the content of the Web page that is the graphics, images and videos and how they are displayed, the XML handles the description of data and information formats, their storage and the transportation and sharing over the internet.

4 0
3 years ago
Read 2 more answers
I'm new to programming and I'm starting with c++, so the first program I want to write should take a string of characters and ou
Amanda [17]
#include <iostream>
#include <string>

using namespace std;

int main() {

string userInput;
cout << "Enter word" << endl;

cin >> userInput;

cout << "you entered" << endl;
cout << userInput;

return 0;

}
5 0
3 years ago
Read 2 more answers
Other questions:
  • Which spereadsheet type will determine<br> how well a bussiness has done over the past year
    11·1 answer
  • Is it okay to leave your car running while parked?
    15·1 answer
  • Which language is the most popular language for writing apple os x?
    9·1 answer
  • What layer uses the UDP protocol
    6·1 answer
  • A computer technician has successfully returned a laptop to full operation and verified system functionality. Actions the techni
    9·1 answer
  • Write a VB.Net program to print numbers from 10 to 20 in descending order using a For Statement.
    14·1 answer
  • Question 1<br> REVPAR and REVPOR are basically the same thing.<br> True<br> False
    11·1 answer
  • The _____ of a story describes the time and location of a story.
    5·2 answers
  • PLEASE HELP!!! NO LINKS!! I'LL GIVE BRAINLIEST!!
    12·2 answers
  • Which original VPN protocol is supported by most platforms but offers low levels of security?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!