doobybug
February 24th, 2009, 12:34 PM
Hi guys,
I don't know whether somebody can help me. I have 2 algorithms and I need to find their best and worst case in terms of the big O notation.
The first 1 is:
for(i = 0; i < = n; i++){
for(j = 0; j < = n; j++){
C[i,j] = A[i,j] + B[i,j]
}
}
The second 1 is:
while (n > = 1){
n = n DIV 2;
}
Any kind of help is highly appreciated! Thanks a lot mates
I don't know whether somebody can help me. I have 2 algorithms and I need to find their best and worst case in terms of the big O notation.
The first 1 is:
for(i = 0; i < = n; i++){
for(j = 0; j < = n; j++){
C[i,j] = A[i,j] + B[i,j]
}
}
The second 1 is:
while (n > = 1){
n = n DIV 2;
}
Any kind of help is highly appreciated! Thanks a lot mates