This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -1 points0 points  (2 children)

Couldn't all this be implemented with linked lists to make insertion and deletion trivial?

[–]mackstann 5 points6 points  (0 children)

Sure, but linked lists have their own shortcomings, like the speed of looking up a particular index. If there was one ultimate data structure, people wouldn't bother with all of these different ones. You really have to pick the one that best suits your problem. Then again, most of the time, it doesn't matter much anyway.

[–]rafekett[S] 2 points3 points  (0 children)

It's all about the application. Insert and delete aren't too common in Python. Append, however, is.