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
Every preprocessing directive must begin with:
Anni [7]

Answer:

B. #

Explanation:

Every preprocessing directive must begin with the # character.

For example:

#define : Used to define a macro

#ifndef : Conditional evaluation of macro

#include : Used to include other preprocessor header file as part of the code

As we can see each of the directives begins with the # character. This is a signal to the preprocessor to interpret the subsequent keyword as a directive.

3 0
3 years ago
Help please, on tuesday we have oral presentation in zoom and i am afraid to speak in front of people, and i don't know what to
Lapatulllka [165]

Answer:

You should be strong, and be sure about what you want to say. Make sure when you speak it is clear, and makes sense.

Explanation:

If you don't speak up or sound like you know what you are talking about. I like to think of it as dancing. Act like you own the stage, or in your case, like you own the presentation. Also, I suggest you speak to your teacher in private, about him ignoring you. If I were you, I would look for newer friends. Ones that won't ignore you.

6 0
3 years ago
People who enjoy working with their hands might enjoy a career as an
Kaylis [27]
People that enjoy working with their hands might enjoy being a construction worker but their are a lot of other jobs that involve using their hands but being a construction worker takes a lot of effort and a lot of hard work to complete.
6 0
3 years ago
Read 2 more answers
at the bank there is 4 lines with 7 costumers and there are five customers left over. how many customers are there​
mrs_skeptik [129]
Answer: 33
7 times 4 is 28 add the left over 5 makes 33 people
4 0
3 years ago
Applying patches is much easier today because of the advent of:
Nadusha1986 [10]

Answer:

A. The internet.

Explanation:

Patches can be defined as software updates released by developers to add new features, upgrade software, install new drivers and fix notable functionality issues (software bugs) associated with an installed software application. These software patches are usually made available on the software developer's website and other third-party platforms for download by the end users.

Hence, through the availability of a network connection (internet), patches are uploaded to the cloud or file server by the software manufacturer or developer for continuous and easy access (download) to all interested users. Thus, applying patches is much easier today because of the advent of the internet.

6 0
3 years ago
Other questions:
  • . char values are surrounded by _____ quotes
    15·1 answer
  • What natural resource are available on the coast but not somewhereelse
    13·1 answer
  • Jenny is the project manager and her company. She needs to break her current project into parts that her employees can work on.
    10·1 answer
  • How to write a function that counts the letters in a string in C?
    13·1 answer
  • The operating system provides a ____, which is the means with which you interact with the computer
    5·1 answer
  • A home user reports to a network technician that the Internet is slow. The network administrator discovers that multiple unknown
    12·2 answers
  • Which text features does this section contain? Check all that apply.
    15·1 answer
  • Why is failure important when you are designing a solution to a problem?
    6·2 answers
  • Shane is working on a new project for the sales department. The company wants a way to allow the sales force to print orders at
    5·1 answer
  • Where can a client identify the instant deposit options for their QuickBooks Payments account?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!