SortedList
class SortedList[T]
Fields
1
T
type
Constructors
1
Properties
1
Methods
2
clear(self: Self)
Defined in
sortedlistRemove all values from sorted list. Runtime complexity: $O(n)$
add(self: Self, value: T)
Defined in
sortedlistAdd value to sorted list.
Runtime complexity: $O(\log(n))$ (approximate).
>>> sl = SortedList()
>>> sl.add(3)
>>> sl.add(1)
>>> sl.add(2)
>>> sl
SortedList([1, 2, 3])
Special methods
3