Possible Duplicate:
Plain English explanation of Big O
I was recently asked about my knowledge of how to use Big O notation and I was stumped because I had never come across Big O before. I have read the Wikipedia page about Big O and looked at some of the questions posted in Stackoverflow but I just simply don't understand.
My question: Can someone provide an explanation of Big O in the simplest form and provide an example of how to use it in the following Java method:
public int getScore(int[] dice)
{
int[][] dups;
dups = possibleDups(dice);
// Set catScore
for (int[] i : dups)
{
for (int k = 0; k < i.length; k++)
{
if (i[k] > 0)
{
switch (i[k]) {
case 1:
catScore = Category.ONES;
break;
case 2:
catScore = Category.TWOS;
break;
case 3:
catScore = Category.THREES;
break;
case 4:
catScore = Category.FOURS;
break;
case 5:
catScore = Category.FIVES;
break;
case 6:
catScore = Category.SIXES;
break;
case 7:
catScore = Category.SEVENS;
break;
case 8:
catScore = Category.EIGHTS;
break;
default:
catScore = Category.NONE;
break;
}
}
}
}
return sumAll(dice);
}