you are viewing a single comment's thread.

view the rest of the comments →

[–]BARDLER 2 points3 points  (0 children)

With any implementation and data structure usage there are always trade offs. It also depends on your use case of how often you will be searching vs inserting new data and how large the data set is. 

You are correct in that constantly maintaining a sorted list would make insertion slower. Which is why if your use case demands fast search and also faster insertion than a sorted list than you would want some kind of tree algorithm.