Menu

Problem Description 1 1 Given Data Generation Storage System Described Undirected Graph N Q43792514

Problem Description - 1/1 Given a data generation and storage system, described by an undirected graph with N nodes and M edgConstraints • 1sns 10^5 • 1sms 10^5 1s datali)s 10^4 1s edges[i)li]s 10^5Frid Tox Input Format For Custom Testing The first line contains an integer, n, denoting the number of elements in data The nPlease 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<n) contains an integer describing datai. The next line contains an integer, 2, denoting the number of columns in edges. Each linei of the m subsequent lines (where0si<m) contains 2 space separated integers each describing the row edgesi 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, thus the answer is 3. 3. 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. 1 2 mo12m 2122 Show transcribed image text 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

Expert Answer


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

OR