Skip to content

Instantly share code, notes, and snippets.

@tnhansel
Last active December 26, 2015 09:28
Show Gist options
  • Save tnhansel/7129262 to your computer and use it in GitHub Desktop.
Save tnhansel/7129262 to your computer and use it in GitHub Desktop.
search algorithm
import java.util.ArrayList;
public class Search {
public static void searchComputer(ArrayList<MobileComputer> arrayList){
MobileComputer a;
boolean found = false;
for (int i=0; i<arrayList.size(); i++ ){
if (arrayList.get(i).getSerialNumber()>arrayList.get(i+1).getSerialNumber()){
a = arrayList.get(i);
found = true;
}
}
}
}
@danggrianto
Copy link

line 10: why?
line 11: what is a for?

@danggrianto
Copy link

itu dicoba jalanin programnya.. bisa apa ga...

@tnhansel
Copy link
Author

sorry, I haven't done anything. Kmrn alu bljr statistcs and ketiduran. I'll try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment