Array contains both prime and non prime number.
In first cast I want to sort all the number whether it is prime or non prime. (It is time complexity for worst case is O(n^2).
In the second case I want to sort only prime number other numbers will be at there original location. Say input is ( 7,3,4,2) output will be (2,3,4,7).