I will eventually be giving this program an input file of like 60,000 400-pixel images, so I am trying to get an idea of how this code will run with a large input. I replaced unimportant stuff with "blah" and all the ArrayList names with simple letters (nn
, mm
, and kk
) for readability.
for (Perceptron P : nn){
//blah
}
for (Perceptron P : mm) {
//blah
}
for (Perceptron P : kk){
//blah
}
for (Perceptron P : mm) {
for (int i = 0; i < nn; i++) {
//blah
}
for (int j = 0; j < kk; j++){
//blah
}
}
for (Perceptron X : nn){
for (Perceptron Y : mm){
//blah
}
}
for (Perceptron Z : kk){
for (Perceptron Y : mm){
//blah
}
}
I think the answer is O(nn+mm+kk+mm(nn+kk)+nnmm+kkmm
). If I know that nn
is 400, mm
is 300, and kk
is 10, then this is O(246710). But now I'm stuck. I don't really know what O(246710) means. Do I have to calculate the big-O with respect to only one of the variables at a time? If so, what good would that do? I'm just trying to get an idea of how this will perform. Thanks