Time Complexity Reference
A clean, fast reference guide for the time complexity of built-in methods across popular programming languages.
Overview
This site provides a quick lookup for the time complexity of built-in data structure methods across multiple programming languages - useful for code reviews, and writing performant code.
Languages Covered
Features
- Per-language breakdown of data structure methods
- Color-coded complexity badges (O(1), O(n), O(log n), O(n log n), O(n²))
- Filterable by data structure (Array, Map, Set, Object, etc.)
- Syntax-highlighted code blocks
Stack
- Next.js - App Router
- MDX - Content via
next-mdx-remote - Tailwind CSS - Styling
- shadcn/ui - UI components
- Shiki - Code highlighting
Contributing
bash
git clone https://github.com/gitmahin/time-complexity-reference.git
cd time-complexity
npm install
npm run devOpen http://localhost:3000 in your browser.
Want to add a language or fix a complexity entry? PRs are welcome.
- Add your language data in
src/constants/data.constant.ts - Create the corresponding MDX file in
src/content/ - Add the language to
listOfProgrammingLanguagesWithLinks->src/constants/sidebar.constant.ts - Open a pull request