Get the latest tech news
Python Big O: Time complexities of different data structures in Python
The time complexity of common operations on Python's many data structures.
Time complexity is one of those Computer Science concepts that's scary in its purest form, but often fairly practical as a rough " am I doing this right" measurement. Python's collections module includes a Counter class which can efficiently count the number of times each item occurs within a given iterable. When you do need a data structure that's optimized for specific operations, you can always lookup an implementation online or find a PyPI module (such as sortedcollections).
Or read this on Hacker News