Re:Everything I wish I knew when learning C
by LegionMammal978 on Monday November 28, 2022 @11:13PM
(#33783609)
I don't think we're actually in disagreement here. It looks like I misread the parent comment to be claiming that fixed-size array assignment ought to be considered O(N), when no such claim is made.
[ Parent
| on HN ]
Re:Everything I wish I knew when learning C
by DSMan195276 on Tuesday November 29, 2022 @12:52AM
(#33784137)
Yeah to clarify I'm definitely in agreement with you that it's O(1), the size is fixed so it's constant time. It's not like the 'n' has to be "sufficiently small" or something for it to be O(1), it just has to be constant :)
People are being very loose about what O(n) means so I attempted to clarify that a bit. Considering what assignments can already do in C it's somewhat irrelevant whether they think it's O(n) anyway, it doesn't actually make their point correct XD