3 ms·
i would point out that implementing a list with an array is lazy madness. i've seen this before and it always results in the same fundamental problem - you lose
by jheriko 13y ago
i would point out that implementing a list with an array is lazy madness. i've seen this before and it always results in the same fundamental problem - you lose the performance benefits of the list because it incurs the performance penalties of an array for insertion and removal when you already have a node.
i've seen this same fundamental blunder in AAA game code bases that will remain nameless...
so its not just choosing the right data structure, but understanding the implementation well enough that you chose the correct implementation of a data structure - which might not be the one in the standard library unfortunately
- icebraining 13y agoI'm hardly a very experienced programmer, but almost all uses of lists I see on Python codebases involve appending, iterating and reading/setting specific values; I couldn't tell you the last time I saw an insert to the head/middle of a list.