I calculate the optimal case complexity, average, and worst of this algorithm in java, I think if good is O (1) in the worst case is O (n), but I do not know if average! could you help me on how to calculate it? thank you!
public boolean searchFalse(boolean[] b){
boolean trovato=false;
for(int i=0;i<b.length;i++){
if(b[i]==false){
trovato=true;
break;
}
}return trovato;
}