> For the complete documentation index, see [llms.txt](https://cs61b-2.gitbook.io/cs61b-textbook-spring-2026/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cs61b-2.gitbook.io/cs61b-textbook-spring-2026/12.-asymptotics-ii/12.5-summary.md).

# 12.5 Summary

### **Takeaways**

* There are no magic shortcuts for analyzing code runtime.
* In our course, it’s OK to do exact counting or intuitive analysis.
* Know how to sum 1 + 2 + 3 + ... + N and 1 + 2 + 4 + ... + N.
* We won’t be writing mathematical proofs in this class.
* Many runtime problems you’ll do in this class resemble one of the five problems from today.
* This topic has one of the highest skill ceilings of all topics in the course. All the tools are here, but **practice** is your friend!
* Different solutions to the same problem, e.g. sorting, may have different runtimes (with big enough differences for the runtime to go from impractical to practical!).
* $$N^2$$​​ vs. $$Nlog(N)$$ is an enormous difference.
* Going from $$Nlog(N)$$ to $$N$$ is nice, but not a radical change.

Hopefully, this set of examples has provided some good practice with the techniques and patterns of runtime analysis. You can also find extra practice problems in the next section. Remember, there are no magic shortcuts, but you have to tools to approach the problems. Go forth and analyze!!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://cs61b-2.gitbook.io/cs61b-textbook-spring-2026/12.-asymptotics-ii/12.5-summary.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
