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
In a cron table entry, what field specifies the absolute pathname to a command that is to be executed?
liraira [26]
The last one. You can also pass arguments to the command.
6 0
3 years ago
Explain how arrays are stored in memory? Show how arr [5] is stored in the memory. Assume each memory location is one byte long
Black_prince [1.1K]

Explanation:

Array is collection of similar data types it is a linear data structure.Array stores elements in a contiguous memory location.

We have an array arr[5]  of size 5 and it is of integer type.Suppose the starting address of the array is 2000 and each memory location is one byte long.As we know that the size of integer is 2 or 4 bytes we take it 2 bytes.

If the starting address is 2000 that is of index 0 then the address of index 1 is 2000+2=2002.

address of index 2=2004.

address of index 3=2006.

address of index 4=2008.

Since size of int is 2 bytes hence we add two memory location.

8 0
2 years ago
The memory capacity in bits for performing the operation y = f (x) using the table lookup method, where x is an 8-bit number and
Flura [38]

Answer:

The page field is 8-bit wide, then the page size is 256 bytes.

Using the subdivision above, the first level page table points to 1024 2nd  level page tables, each pointing to 256 3rd page tables, each containing 64 pages. The program's address space consists of 1024 pages, thus we need we need 16 third-level page tables. Therefore we need 16 entries in a 2nd level page table, and one entry in the first level page table. Therefore the size is: 1024 entries for the first table, 256 entries for the 2nd level page table, and 16 3rd level page table containing 64 entries each. Assuming 2 bytes per entry, the space required is 1024 * 2 + 256 * 2 (one second-level paget table) + 16 * 64 * 2 (16 third-level page tables) = 4608 bytes.

First, the stack, data and code segments are at addresses that require having 3 page tables entries active in the first level page table. For 64K, you need 256 pages, or 4 third-level page tables. For 600K, you need 2400 pages, or 38 third-level page tables and for 48K you need 192 pages or 3 third-level page tables. Assuming 2 bytes per entry, the space required is 1024 * 2 + 256 * 3 * 2 (3 second-level page tables) + 64 * (38+4+3)* 2 (38 third-level page tables for data segment, 4 for stack and 3 for code segment) = 9344 bytes.

Explanation:

16 E the answer

5 0
2 years ago
Which type of cloud computing offers easily accessible software and applications on the machines?
blsea [12.9K]

Answer

Software as a service

Explanation

Software as a service (SAAS) is a software distribution model in which a third-party provider hosts applications and makes them available to customers over the Internet. SAAS is one of three main categories of cloud computing.

Cloud computing is the use of internet  to access hardware and software service instead of keeping regular physical hardware and software in the office space. Basically it is the practice of using a network of remote servers hosted on the Internet to store, manage, and process data, rather than a local server or a personal computer.

6 0
2 years ago
"The term ____ refers to the programs or instructions used to tell the computer hardware what to do."
Anuta_ua [19.1K]

Answer:

Software is the correct answer.

Explanation:

Software is the collection of programs or the group of instruction through which the computer system's hardware knows that what works they have to do. In other words, it is the computer program through which hardware of the computer systems understand how to work. There are several types of software such as application software, system software, and utility software.

8 0
3 years ago
Other questions:
  • How do you increase the amount of data in a sampled Google Analytics report?
    8·1 answer
  • How long does it take a letter to arrive?
    9·1 answer
  • Alright, don't judge me, this is a question that involves my Childhood game PvZ GW 2. So I noticed mods and stuff that get uploa
    12·2 answers
  • ) Which is true about the agile method?
    7·1 answer
  • This is not based on homework but I have a question. I am currently using a gtx 960 with a 6 core amd processor. Does anyone kno
    6·1 answer
  • Clunker Motors Inc. is recalling all vehicles in its Extravagant line from model years 1999-2002 as well all vehicles in its Guz
    15·1 answer
  • A human subject’s photographs show two catchlights in each eye that are unwanted by the photographer. What is the most likely ca
    12·1 answer
  • Ask the user to input a word. Then, print the first letter, the last letter, and the length of the word on the same line with no
    6·1 answer
  • Can an SQL function return multiple values? No answer needed, take the points.
    12·1 answer
  • ravi met few peoples in a party and was mixing up well those wearing expensives clothing and fair complexion . which factors are
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!