# Overview

For every algorithm, it is important to understand the following:

1. What problem does this algorithm solve?
2. When can this algorithm be applied? (i.e., what are the preconditions? When does the algorithm fail?)
3. Why does the algorithm give the correct answer?
4. What is the key invariant behind this algorithm?
5. What is the running time of the algorithm? Are there any optimisations possible?


---

# 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://cs2040s.devanshshah.dev/algorithms/overview.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.
