Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please code in java Problem Description - 1/1 Given a data generation and storage system, described by an undirected graph with N nodes and M

image text in transcribedimage text in transcribedimage text in transcribedPlease code in java

Problem Description - 1/1 Given a data generation and storage system, described by an undirected graph with N nodes and M edges. Each node will generate a certain amount of data units, given as data, for node i For every node i, the data it generates will be either stored in node i itoel, or any of the nodes, connected with node i by an edge. The system makes the decisions on where to store the generated data automatically. Since the system in new, the decinions wondering, what is the maximum possible total amount of data that will need to be stored in a single node in the worst case? makes are not always perfect, and you're Function Description Complete the maxData function in the editor below. It has the following parameter(s): Description Name Type data INTEGER ARRAY amounts of data generated in each node Parameters for every row, two nodes connected by the corresponding edge INTEGER 2D ARRAY edges The function must return an INTEGER denoting the the maximum possible amount of data that will need to be stored in a single node in the worst case. Return Constraints 1sns 10^5 1sms 10^5 1s datali)s 10^4 1s edges[i)li]s 10^5 Frid Tox Input Format For Custom Testing The first line contains an integer, n, denoting the number of elements in data The nedt line contains an integer, m, denoting the number of rows in edges Each linei of the n subsequent lines (where 0si<>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What benefits and problems does dynamic addressing provide?

Answered: 1 week ago