In a permutation \(a_1.....a_n\) of n distinct integers, an inversion is a pair \((a_i, a_j)\) such that \(i \lt j\) and \(a_i \gt a_j\). What would be the worst case time complexity of the insertion Sort algorithm, if
the inputs are restricted to permutations of 1....n with at most n inversions?
- A\(\Theta (n^{2})\)
- B\(\Theta (nlogn)\)
- C\(\Theta (n^{1.5})\)
- D\(\Theta (n)\)