"Alex Martelli" <aleax at aleax.it> writes: > I think this should be constant-amortized-time, I think logarithmetic amortized time, i.e. calling pop N times takes O(N log N) time (because it has to do a linear-time operation every so often).