3 ms·
You can't prove that list.pop in Python is always O(1) (imagine there is a bug in a reference implementation). But you can test that assumption for any given im
by d0mine 17y ago
You can't prove that list.pop in Python is always O(1) (imagine there is a bug in a reference implementation). But you can test that assumption for any given implementation.
- andreyf 17y agoGiven an implementation of Python, yes, you can prove list.pop will run in some (constant, one would hope) number of clock cycles on an abstract architecture. Building reliable machines to simulate such architectures is part of CS, but not a science. Science is the construction of abstract models which match observed phenomena.