Given that rho can vary with the input and is completely arbitrary value, shouldn’t be also called n?
Memories on the subject are not great so might be saying bullshit in here
Memories on the subject are not great so might be saying bullshit in here
In some other typical cases (otherwise sorted array with one element inserted, two sorted arrays appended to each other) rho is 3 and 2, so also O(n).
For instance, timsort is also very fast if only a single element is unsorted, or only two elements, or only three elements. These are not special cases explicitly handled, its just the natural way the algorithm works.
You can call it `m` or `rho` or whatever, just use a different variable.
In randomized input with uniform statistics, should be on average (n - log n) which also gives a handle on theta notation complexity.