Menu

Problem Description 1 1 Given Data Generation Storage System Doncribed Undirected Graph N Q43792510

Please code in java

Problem Description - 1/1 Given a data generation and storage system, doncribed by an undirected graph with N nodes and MedgeConstraints • 1sns 10^5 • 15m 1045 • 1 <data[i] < 10^4 • 1 s edges[i][i] = 10^5Input Format For Custom Testing The first line contains an intern denoting the number of elements in data The red line contai

Problem Description – 1/1 Given a data generation and storage system, doncribed by an undirected graph with N nodes and Medges Each node will generate a certain amount of data units, given as data for node . For every node 1, the data it generates will be either stored in moderne, or any of the nodes, connected with node i by an edge. The b lom makes the decisions on where to store the generated data automatically. Since the system is new, the decisions it makes are not always perlea, and your wondering what is the maximum possible total amount of data that will need to be stored in a single node in the worst case? Function Description Complete the maxData function in the editor below. It has the following parameter(s): Name Type Description data INTEGER ARRAY amounts of data generated in each node Parameters edges INTEGER 2D ARRAY for every row, two nodes connected by the corresponding edge Return 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. Constraints • 1sns 10^5 • 15m 1045 • 1 <data[i] < 10^4 • 1 s edges[i][i] = 10^5 Input Format For Custom Testing The first line contains an intern denoting the number of elements in data The red line contains an integer, m, denoting the number of rows in edges Schlinelor then subsequent lines (where o n contains an integer describing data The next line contains an integer, 2, denoting the number of columns inepes Each line of them subsequent lines (where Osim) contains 2 space separated integers each describing the rowedol Sample Cases Input Output Output Description There are no edges, so every node will contain only the data generated in it. The 1st node will contain 1 unit of data, the 2nd node will contain 2 units of data, and the 3rd node will contain 3 units of data thuth answer is 3 WN The 1st node generates 2 units of data, the 2nd node generates 2 units of data. There is an edge between the 1st and the 2nd nodes, so there are two possible worst case scenarios: 1) all generated data will be stored in the 1st node 2) all generated data will be stored in the 2nd node In both cases, the amount of data the node will need to store is 2+2-4 units of data, thus the answer is 4 Show transcribed image text Problem Description – 1/1 Given a data generation and storage system, doncribed by an undirected graph with N nodes and Medges Each node will generate a certain amount of data units, given as data for node . For every node 1, the data it generates will be either stored in moderne, or any of the nodes, connected with node i by an edge. The b lom makes the decisions on where to store the generated data automatically. Since the system is new, the decisions it makes are not always perlea, and your wondering what is the maximum possible total amount of data that will need to be stored in a single node in the worst case? Function Description Complete the maxData function in the editor below. It has the following parameter(s): Name Type Description data INTEGER ARRAY amounts of data generated in each node Parameters edges INTEGER 2D ARRAY for every row, two nodes connected by the corresponding edge Return 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.
Constraints • 1sns 10^5 • 15m 1045 • 1

Expert Answer


Answer to Problem Description – 1/1 Given a data generation and storage system, doncribed by an undirected graph with N nodes and …

OR