This section provides exercises for better understanding in disjoint sets.
Create the GraphQuizarrow-up-right class under the grapharrow-up-right package.
GraphQuiz
graph
Update the numberOfCycles() method that returns the number of all cycles in the graph.
numberOfCycles()
Make sure to find all atomic cycles; do not count cycles that can be created by simply combining other cycles.
Write a report quiz6.pdf that includes the followings:
quiz6.pdf
Explain the worst-case complexity of the algorithm for your numberOfCycle() method.
numberOfCycle()
For the topological_sort()arrow-up-right method in the Graph class, explain why the condition for the exception indicates that the graph includes a cycle.
topological_sort()
Graph
Last updated 3 years ago
Was this helpful?