Reference no: EM13165765
Requirements: implement/update specific methods for the DFS of a graph; for at least 2 graphs (1 being the provided one), show the DFS order of vertices in the graph, and for each node, specify its parent node in the search (the node from which the currect node was reached). Moreover, display for each node the discovery and finishing time, to check that the Parenthesis Theorem holds true.
Approach:For counting the dfs time, you should set a global counter (let's name it time), which is set to 0 in the moment the search starts with the root vertex. At any moment the search starts with a new vertex (that is, justafter entering a new dfs) the counter has to be incremented by one; also it has to be incremented by one when the search from the current node ends (just before exit a dfs). For each node, calculate also the discovery and finishing time; for doing this, you may use two arrays (let's name them d[] for discovery and f[] for finishing). The discovery time of a given vertex v receives the value of the counter just when enter to the dfs for that vertex (that isd[v]=time, before incrementing time), and the finishing just before exit from that dfs (that is f[v]=time, before decrementing time).
Parentheses Theorem: In any depth first search, for any 2 vertices u and v, one of the following 3 conditions holds true:
- The intervals [d[u], f[u]] and [d[v], f[v]] are completely disjoint;
- The [d[u], f[u]] interval is completely contained within interval [d[v], f[v]], and u is a descendant of v in the dfs tree;
- The [d[v], f[v]] interval is completely contained within interval [d[u], f[u]], and v is a descendant of u in the dfs tree;
Design and implement a driver to show the following (check for 2 graphs; 1 is provided, including the starting vertex):
- Display the dfs starting from a specified vertex;
- Display the discovery/finishing time for each node in the graph;
- Show the Parentheses Theorem holds true, by mentioning the specific condition in each case (this has to me manually calculated and added in the documentation).
Input data: You should test your application and include the tests in your documentation for at least two graphs; one is mandatory to be this one provided below. It is represented in the G = (V, E) representation, where V is the vertices set, and E is the edges set. Please note that our graph is a directed one (that is edges have directions, thus, the presence of an (u, v) edge does not imply (v, u) is also present in the graph). Nevertheless, this has no impact on the algorithm and its implementation. The dfs should start with vertex 1.
V= {1, 2, 3, 4, 5, 6, 7}
State the effective charges on h and cl in the hcl molecule
: Compare your answers with the following: the effective charges on H and Cl in the HCl molecule are +0.178 and -0.178. A. HBr has a smaller dipole moment and a longer bond length than HCl
|
Pseudo-code in assembly language
: Implement the following pseudo-code in assembly language (assume unsigned numbers). Declare Apple and Pear as byte sized variables.
|
Override the insert method in bst
: You should override the insert method in BST. Your overriding method should first call the method it is overriding. When 50 insertions have been performed since the last rebalancing.
|
Valuate kp for the reaction at temperature
: At a given temperature, 1.40 atm of H2 and 2.03 atm of I2 are mixed and allowed to come to equilibrium. The equilibrium pressure of HI is found to be 1.305 atm. Calculate Kp for the reaction at this temperature.
|
Implement/update specific methods for the dfs of a graph
: implement/update specific methods for the DFS of a graph; for at least 2 graphs (1 being the provided one), show the DFS order of vertices in the graph, and for each node,
|
Volume of edta required to reach the indicator end-point
: if you dissolve the weighed mass of zinc in water which had not been deionized, how would the volume of EDTA required to reach the indicator end-point
|
A program that reads a four-digit number from the keyboard
: Write a program that reads a four-digit number from the keyboard as a string and then converts it into decimal. For example, if the input is 1100, the output should be 12. Hint: Break the string into characters and then convert each character to a va..
|
Demonstrated understanding of key economic concepts
: At the national level, public debate has centred on the performance of the main monetary measure – GDP. Each year we must do better than the last; otherwise we are officially in recession…while GDP growth is important for raising living standards, it..
|
Designing a game system
: Suppose that you are designing a game system that responds to players' pressing buttons and toggling joysticks. The prototype system is failing to react in time to these input events.
|