Well, admittedly in this situation linked lists or ("smart") arrays mostly come down to how allocation is handled. If the usage is really simple that's where the most time will be spent. A competitive implementation would probably need some kind of pool to give out elements from to avoid any kind of real memory allocation and non-inlinable calls. That's not exactly going to fit into the 50 loc.