Skip to content

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.

License

Notifications You must be signed in to change notification settings

jaimin-bariya/python-complexity-cheatsheet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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! 🚀

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published