Fwiw, to help with maintaining things I'd just put the sort code in the list include file, i.e. make it part of the data structure itself.
That leads me to a different solution entirely. In your actual use case for this sorting where does the data come from? One thing you could do is make the list sorted all the times. You could do that with the current test as well. It just depends on how you implement insert. If you assume the list is sorted (which it is by definition when empty) you can use a binary search (logN) to insert new elements in the right place. This means you no longer ever need to sort the whole list. Your list implementation is designed to handle insert and removal eficiently. Also you get benefits of a sorted list for general finds as well. I should have done that for the challenge, then the sort operation is a no-op and would never TMI no matter how many elements you put in (within practical reason) '>
Yes I know about this and it could lead to very exciting results. The question in this implementation is how big can the list must be to adding+sorting new element produced TMI. I was bit busy to test this case but its on my schedule.
Of course since adding elements would be usually done in a iteration or recursion, there still must be delay if someone would want to store more than 1000 elements, but in the end, this method should provide best results from all.