: A multi-graph is a graph which may have more than one edge (parallel edges) between a pair of vertices. Suppose that these graphs may also have self-loops (an edge from a vertex to itself). Given such a graph G as an input, print the adjacency list representation of an equivalent undirected graph G’, in which all the multiple edges between two vertices are replaced by a single edge, and all self-loops are removed. Your algorithm should run in O(n+m) time. Input Format: The input is a text file which gives the adjacency list representation of the multigraph. The first line specifies the number of vertices and edges n and m. The next m lines specify the m edges, one edge per line. Assume the vertices are numbered 0 to n-1. Output Format: The adjacency list representation of the new graph G’. Sample Input (for the graph above): 3 6 0 0 0 2 2 2 0 2 0 2 0 1 Sample Output: Adjacency list representation of G’: 0: 1 2 1: 0 2: 0
Given a directed graph in adjacency matrix form, determine if it contains a universal sink – a vertex with in-degree n-1 and out-degree 0. (The number of vertices in the graph is n.) Input Format: The input is a text file which gives the adjacency matrix representation of a directed graph. Sample Input (for the graph above): 0 1 1 1 0 0 0 1 0 0 0 1 0 0 0 0 Sample Output: Yes
Problem 1: Given input undirected graph, create and print adjacency list and adjacency matrix representations graph. Input Format: The input is a text file which describes undirected graph. The first line file specifies n & m, number of vertices and number edges graph respectively. The next m lines specify m edges of the graph, one line per edge. An edge described by its end points. If number vertices is n, assume that vertices graph are numbered (0,1,..n-1). Output Format: Print adjacency list and adjacency matrix representation of the graph. adjacency list representation, for given vertex, order of its adjacent vertices does not matter. Sample Input (for the graph shown above): 8 10 0 1 1 2 0 3 3 4 3 6 4 6 5 4 5 6 7 6 5 7 Sample Output: Adjacency list representation: 0: 1 3 1: 0 2 2: 1 3: 0 6 4 4: 3 6 5 5: 4 6 7 6: 3 5 4 7 7: 5 6 Adjacency matrix representation: 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 1 0 0 0 0 0 1 0 1 1 0 0 0 1 1 1 0 1 0 0 0 0 0 1 1 0
preprocess the data and by giving a proper rationale behind the steps you would follow. The two datasets should be merged before preprocessing. first task in your new job, to check the quality of the data for the next step of analysis. Following are the additional description
a) The data set contains six variables - Date,Open,Close,HIgh,Low,volume
the stock market opens at 9:15 hours and closes at 15:30 hours. Each stock is defined by an opening and a closing price which are the prices it opens and closes with. Within the operating hours, the stock price touches a maximum and minimum which are the highest and lowest prices achieved by the stock in the working hours of the stock market. You have access to ten years of monthly stock price data . On some days when there is no trading.Furthermore, your manager also claims that the model prediction is too bad since data is polluted.
1. Calculate the electric potential of q1 = 25.0nC at (a) 1.00m, (b) 2.00m, and (c) infinite long distance from it.
2. Calculate the potential energy that another charge q2 = 5.00nC possess when placed at the three different points of the previous example.
Given the demand function P = 20 – 5Q, find the price elasticity of demand when price of the commodity is 5 Birr per unit. Mention if the demand is price elastic or inelastic at this point
Final Value with Appreciation
Given principal amount
principal as an input, time period in years time and appreciation percentage apprPercentage as optional inputs, write a JS function to return the final value finalValue with the given appreciation percentage and time period. The default values for time and apprPercentage are 2 and 5 respectively.
Quick Tip
The formula to calculate the final value with appreciation is,
finalValue = principal * (1 + time * appreciation / 100)
Input
The first line of input contains a number principal
The second line (optional) of input contains a number time
The third line (optional) of input contains a number apprPercentage
Output
The output should be a single line containing the finalValue
Sample Input 1
1000
2
3
Sample Output 1
1060
Sample Input 2
3000
Sample Output 2
3300.0000000000005but
sample input 2
2000
helf me how to solve it
List the elements of {1, 2, 3, 4} ∩ {2, 3, 5, 7}
Let f(x)=x, show that f is Riemann integrable in the interval [a,b]. Hence find the Riemann integral of f.
A metal wire 75.0 cm long and 0.130 cm in diameter stretches 0.0350 cm when a load of 8.00 kg is hung on its end. Find the stress, the strain, and the Young’s modulus for the material of the wire.