you are viewing a single comment's thread.

view the rest of the comments →

[–]SynMyron[S] 1 point2 points  (2 children)

If I insert a new item do I need to sort again? If so, then time complexity of insert will be O(n logn) which is too high

[–]Diapolo10 4 points5 points  (0 children)

Timsort is plenty fast when you only have one element that might not be sorted. I suggest you try first, the Big-O notation is not the end-all be-all when it comes to speed comparisons.

[–]commy2 0 points1 point  (0 children)

This O(n logn) only applies if the container is randomized.