Given a stack, what is the minimum amount of swaps needed to sort it? Since the bottom of it stays intact and we slowly move to the upper part of it, if the stack contains n elements, the amount of swaps f(n) would be
f(n) < n
for n = 1, 2, 3, 4, is that correct? I cannot find a more accurate way to express it. Also, how do we calculate the f(n) for n > 4?