An array contains four occurrences of $0$, five occurrences of $1$, and three occurrences of $2$ in any order. The array is to be sorted using swap operations (elements that are swapped need to be adjacent).
- What is the minimum number of swaps needed to sort such an array in the worst case?
- Give an ordering of elements in the above array so that the minimum number of swaps needed to sort the array is maximum.