Resources
Textbooks
| Book | Notes |
|---|---|
| CLRS — Cormen, Leiserson, Rivest, Stein — Introduction to Algorithms (4th ed.) | Primary reference. Rigorous proofs and broad coverage. |
| Sedgewick & Wayne — Algorithms (4th ed.) | More accessible; Java examples, but concepts transfer directly. algs4.cs.princeton.edu |
| Skiena — The Algorithm Design Manual (3rd ed.) | Excellent on problem-solving intuition and the "war stories" chapters. |
Kotlin References
- Kotlin Language Documentation — official reference
- Kotlin Koans — hands-on exercises, ideal for getting up to speed fast
- Kotlin Playground — browser-based REPL, useful for quick experiments
- Kotlin Standard Library API — stdlib reference
Algorithm Visualizers
- VisuAlgo — step-by-step visualizations for sorting, graphs, trees, and more
- Algorithm Visualizer — interactive code + animation
- USFCA Data Structure Visualizations — covers BST, heaps, graphs
Complexity Cheat Sheet
| Structure | Access | Search | Insert | Delete |
|---|---|---|---|---|
| Array | \(O(1)\) | \(O(n)\) | \(O(n)\) | \(O(n)\) |
| Sorted array | \(O(1)\) | \(O(\log n)\) | \(O(n)\) | \(O(n)\) |
| Singly linked list | \(O(n)\) | \(O(n)\) | \(O(1)\)* | \(O(1)\)* |
| Hash map (avg) | — | \(O(1)\) | \(O(1)\) | \(O(1)\) |
| Binary search tree (balanced) | — | \(O(\log n)\) | \(O(\log n)\) | \(O(\log n)\) |
| Min-heap | — | \(O(n)\) | \(O(\log n)\) | \(O(\log n)\) |
* Given a pointer to the node.
Tools
| Tool | Purpose |
|---|---|
| IntelliJ IDEA | Recommended IDE — first-class Kotlin support |
Kotlin CLI (kotlinc) | Compile & run .kt files from the terminal |
| draw.io | Draw trees, graphs, and flow diagrams |
Style Guide
All submitted Kotlin code should follow the official Kotlin coding conventions. Key points:
- 4-space indentation
camelCasefor functions and variables;PascalCasefor classes- Prefer
valovervarwhere possible - Keep functions short and focused — one responsibility per function