This section provides exercises for better understanding in disjoint sets.
Update the numberOfCycles()
method that returns the number of all cycles in the graph.
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:
Explain the worst-case complexity of the algorithm for your numberOfCycle()
method.
For the topological_sort()
method in the Graph
class, explain why the condition for the exception indicates that the graph includes a cycle.