4 ms·
memcpy is not O(1)
by jcelerier 4y ago
memcpy is not O(1)
- LegionMammal978 4y agoIt's O(1) relative to any size computed at runtime: that is, running the same program (with the same array size) on different inputs will always take the same of work for a given assignment.
- jcelerier 4y agoWe're in the context of the assignment operation in the language here. Yes, in C you can only assign statically-known types but that does not mean you can just ignore that a = f(); may take a very different time depending on the types of a and f
- deleted 4y ago[deleted]