This page is the module index for analysis and library costs.
This legacy page is a short map to the foundation sequence: input size and operation counts, asymptotic growth, cost models, loop invariants, array and Python sequence costs, and recursion and recurrences.
bitsandbytes/complexity.py— word RAM model, O/Θ/Ω vocabulary, recursion limit, and the three recurrence shapes (merge divide, halving, linear decrement).bitsandbytes/library_costs.py— why BFS usesdeque,heapq.nsmallest,bisect.insort, and Timsort;list.pop(0)costs O(n) element moves.
Industry
A working engineer checks the language cost table before replacing a loop.
Python's time-complexity documentation lists list.pop(0) as O(n), because
every later element moves, and says to use a collections.deque when both
ends change. That deque documents approximately the same O(1) cost for
appends and pops in either direction.