I dont think this is correct, I need some help badly.


private SimpleList<Integer> buildList(String line) {
//Build a list of integers from line
//Assume the line is syntactically correct
SimpleList<Integer> list;
list = new SimpleList<Integer>();
int i=0;
while(i<=line.length()){
int num=0;
while(i<line.length() && line.charAt(i)!='i');
num=i+(line.charAt(i)-'0');
i++;
list.add(num);
i++;
}
return list;


}


private int findMax(SimpleList<Integer> list) {
//Return the maximum integer in list
int max;
list.reset();
max=list.next();
while(list.hasNext()){
int i=list.next();
if(i>max);
max=i;
i++;
}
return max;
}

private int findMin(SimpleList<Integer> list) {
//Return the minimum integer in list
int min;
list.reset();
min=list.next();
while(list.hasNext()){
int i=list.next();
if(i<min);
min=i;
i++;
}
return min;

}