Finally, I have a solution to the problem, please feel free to comment.
Let's take an example:
int a[] = {1,3,4,6,10,6,16,12,13,15,16,19,20,22,25}
Now, if I put this in the graph (X-coordinate → array index and Y-coordinate value →), then the graph will look like this:

, , , , 10 16. , , min 6, max val 16. , , , (6,16). , :

. , , . , . , , , . .
:
public void getMN(int[] a)
{
int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE;
for(int i=1; i<a.length; i++)
{
if(a[i]<a[i-1])
{
if(a[i-1] > max)
{
max = a[i-1];
}
if(a[i] < min)
{
min = a[i];
}
}
}
if(max == Integer.MIN_VALUE){System.out.println("Array already sorted!!!");}
int m =-1, n =-1;
for(int i=0; i<a.length; i++)
{
if(a[i]<=min)
{
m++;
}
else
{
m++;
break;
}
}
for(int i=a.length-1; i>=0; i--)
{
if(a[i]>=max)
{
n++;
}
else
{
n++;
break;
}
}
System.out.println(m +" : "+(a.length-1-n));
System.out.println(min +" : "+max);
}