Re:Drop millions of allocations by using a linked list (2015)
by dragontamer on Friday March 12, 2021 @10:28AM
(#26436810)
Ah jeez. That's what I get for typing fast.
Yeah, I mean O(1) insert / remove for linked lists, and O(n) memcpys (most array insert / remove operations)
EDIT: I've edited my post above. I think its correct now. Thanks for pointing out the error.
I didn't downvote your comments but memcpy is O(n) instead of O(1) : https://stackoverflow.com/questions/362760/how-do-realloc-an...
I'll delete this reply if you meant something else.