7.4. Quiz

This section provides exercises for better understanding in disjoint sets.

Implementation

  • Create the GraphQuiz class under the graph package.

  • 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.

Report

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.

Last updated

©2023 Emory University - All rights reserved