Topological Sort using DFS :-

Step 1: Select any node from which you want to start. So, suppose if I select 11.
Step2: Then we enter 11 into the visited set. Now, treverse all the nodes which can be reached from 11.
Step 3: From 11, I can reach 2. So, put 2 in the visited node. Now, from 2 can I reach any further node? No. So pop the node 2 and put it into a shorted set.
Step 4: Come back to 11, we again check from 11 which node can we reach i.e., 9 So, put it into a visited set & 9 has no further node. So we pop the node 9 and put it into a sorted set.
Step 5: Repeat step 4. In this we get node 10 in the sorted set.
Step 6: Come back to 11 & check Is there any further node which can be visted from 11? The answer is No. So, we pop the node 11 and put it into a sorted set.
Step 7: Now I have to select one more node. So, suppose I select the node 7. So put it into the visted set & the check the node which can be reach from the node 7. From 7 we can reach 11 & 8 but we already visited the node 11 so we direct visit the node 8.
Step 8: Put the 8 into the visited set & then pop it and put it into the sorted set.
Step 9: Now I select one more node from 5 or 3. So suppose I select 5 so put it into visited set & from this all the node are already visited so we pop it & put it into a sorted set.
Step 10: Similarly the step 9, node 3 also has all visited node so we directly pop from the visited node & put it into a sorted node.
So, the final sorted set is 3,5,7,8,11,10,9,2
And the sorted graph will be:

3. Apply Topological sort algorithm on the following graph. Then, draw the sorted graph. 11 marvel
Apply the topological sort algorithm to the graph. Follow the
algorithm in you textbook and clearly show the content of the three
lists: resultList, noIncoming and remainingEdges after each
iteration.
2. Apply the topological sort algorithm to the graph below. Follow the algorithm in you textbook and clearly show the content of the three lists: resultList, nolncoming and remainingEdges after each iteration GraphTopologicalSort (graph) { resultList = empty list of vertices no Incoming = list of all vertices with no...
7. Can the following graph be topologically sorted? Justify your answer. If it can, use the algorithm discussed in class to provide a topological sort. a.
7. Can the following graph be topologically sorted? Justify your answer. If it can, use the algorithm discussed in class to provide a topological sort. a.
Which of the following is TRUE about Topological Sorting? Topological Sort can be used as a subroutine to find shortest paths in a weighted DAG in time O(V+E); in particular, the time does not depend on the magnitudes of the weights on the edges, and the weights on the edges may be negative. A Topological Sort algorithm sorts the nodes of an arbitrary directed graph G in an order that is consistent with all the paths in G, that is...
(A) Consider the following algorithm for computing a topological sort of a DAG G: add the vertices to an initially empty list in non-decreasing order of their indegrees. Either argue that the algorithm correctly computes a topological sort of G, or provide an example on which the algorithm fails. (B) Can the number of strongly connected components of a graph decrease if a new edge is added? Why or why not? Can it increase? Why or why not? (C) What...
What is the running time of the DFS topological sort algorithm? Justify your answer. Does it make sense to apply iterative deepening to A* search? Briefly explain why or why not
Describe an algorithm to test whether a given directed graph is a tree. Hint: Modify topological sort.
The weights of edges in a graph are shown in the table above. Apply the sorted edges algorithm to the graph. Give your answer as a list of vertices, starting and ending at vertex A. Example: ABCDEFA
3.3. Run the DFS-based topological ordering algorithm on the following graph. Whenever you have a choice of vertices to explore, always pick the one that is alphabetically first. (a) Indicate the pre and post numbers of the nodes. (b) What are the sources and sinks of the graph? (c) What topological ordering is found by the algorithm? (d) How many topological orderings does this graph have?
3.3. Run the DFS-based topological ordering algorithm on the following graph. Whenever you have...
A method sort(a, b, c) will receive 3 parameters a, b, and c, and print a ascending sorted results. For example, sort(3,1,4) will print 1,3,4, sort(- 2,10,3) will return -2,3,10. Draw flowchart diagram to illustrate the algorithm in this method. NOTE: you DON’T have to consider the case that the number of parameters are greater than 3.
In the following graph, write a Java program using Topological
Sort.
please write java code and show me the output.
Thank you :)
b.