My friend told me that deletion of all the elements from vector in big O notation is quadratic performance is worst case (big O notation).
The worst case requires to delete always the first object, and all other elements are shifted to the left by one. So each deletion is linear because it depends on number of elements that need to be shifted.
I created a formula that describes this situation:
n - is array size (number of elements)
k - is a number of elements to remove (it is equal to the array size in my case)
Can we simplify or solve this formula somehow or write it another way?
Thanks in advance.