|
|
|
|
|
by krona
1666 days ago
|
|
CppReference defines the time complexity is constant: https://en.cppreference.com/w/cpp/container/deque/push_front So does this mean:
- We're talking about different complexities (Amortized vs something else)
- The libc++ implementation isn't standards conformant
- The analysis in the c++ standard is incorrect.
- Something else |
|
There is never a way to guarantee that the physical amount of time is bounded by O(1) in the worst case. You could always have pathological scenarios or data structures written so that performing a move or copy of a single T could require O(n^n) time for all anyone knows.