Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.98 KB

README.md

File metadata and controls

50 lines (36 loc) · 1.98 KB

Python Complexity Cheat Sheet 📊

A concise and comprehensive cheat sheet covering time complexities of Python's built-in data structures like Lists, Dictionaries, Sets, Tuples, and Strings. This resource is designed to help developers write efficient and optimized Python code.

🚀 Why Use This Cheat Sheet?

  • Understand the average and worst-case complexities of common operations.
  • Make informed decisions while working with Python's data structures.
  • Write optimized, faster programs with confidence.

🛠️ Cheat Sheets Available:


📚 Highlights

  • Lists: Dynamic arrays with flexible operations.
  • Dictionaries: Hash-based key-value pairs for ultra-fast lookups.
  • Sets: Hash-based collections for unique items and efficient membership tests.
  • Tuples: Immutable, lightweight sequences.
  • Strings: Immutable text sequences optimized for searching and slicing.

📥 Contributions

Want to help us make this cheat sheet even better? Check out our CONTRIBUTING.md file to get started!


📄 License

This project is licensed under the MIT License.


👀 Preview

Here’s a quick look at time complexities for Lists:

Operation Examples Average Case Worst Case
Append l.append(item) O(1) O(1) (resize)
Indexing l[i] O(1) O(1)
Containment item in l O(N) O(N)

For more details, visit our dedicated cheat sheets! 🚀