how to find minimum value index of array from specific position

data structure in java

example


public class example{
public int min(int[] arr,int from)
{
 int minValue=arr[from];
 int minVIndex=from;
 for(int i=from+1;iarr[i])
  {
   minValue=arr[i];
   minVIndex=i;
  }
 }
 
 return minVIndex;
}

public static void main(String arg[])
{
int[] arr= {0,222,3,422,0};
System.out.println(new example().min(arr,1));
}
}

Comments

Popular posts from this blog

delete at last position in java

Create a class named Movie that can be used with your video rental business in java

A publishing company that markets both book and audio-cassette in java. (Solution)