As a followup to this question, I'm attempting to understand how not to add elements to a list
using ++
.
From this answer:
Again if you only want to append a single element to the list, that is not a problem. This is a problem if you want to append n elements that way to a list, so if you each time append a single element to the list, and you do that n times, then the algorithm will be O(n2).
So from my understanding, this means you shouldn't do this:
let numbers = [1,3,5,10,15]
newNumbers = numbers ++ [27]
listofnumbers = newNumbers ++ [39]
Is this what the bold text in the quoted answer telling you not to do? If not, using code, what is the bold text warning you not to do?