Overview of Sorted Containers API
masterThe Sorted Containers library provides three main sorted collection types designed to be efficient and easy to use:
- Sorted List (
SortedList): AMutableSequencethat maintains sort order. It supportsbisect_leftandbisect_rightmethods, and behaves similarly to a standard Python list but with enforced ordering. - Sorted Dictionary (
SortedDict): AMutableMappingwhere iteration yields items in sorted order. It supports efficient positional indexing via anilocview. - Sorted Set (
SortedSet): AMutableSetthat also acts as aSequenceto support efficient positional indexing.