# 7.4. Quiz

## Implementation

* Create the [`GraphQuiz`](https://github.com/emory-courses/dsa-java/blob/master/src/main/java/edu/emory/cs/graph/GraphQuiz.java) class under the [`graph`](https://github.com/emory-courses/dsa-java/blob/master/src/main/java/edu/emory/cs/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.

{% embed url="<https://www.slideshare.net/jchoi7s/graphs-quiz>" %}

## 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()`](https://github.com/emory-courses/dsa-java/blob/master/src/main/java/edu/emory/cs/graph/Graph.java#L142) method in the `Graph` class, explain why the condition for the exception indicates that the graph includes a cycle.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://emory.gitbook.io/dsa-java/graphs/exercises.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
