Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Jason Perry   on Jan 02 In Java Category.

  
Question Answered By: May Hansen   on Jan 02

need to compare the ints in the array, not the indexes.
Should be:
int minIndex(int v[], int first, int last){
if(first==last){return first;}
int tempA = min(v,first,(first+last)/2);
int tempB = min(v,(first+last)/2,last);
if(v[tempA]<v[tempB]) return tempA;
else return tempB;

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Simple but Brain eating Or get search suggestion and latest updates.


Tagged: