Figuring out when one algorithm will be slower than another algorithm I'm studying for a computing exam and came past the following question on a past paper and need help with it.

When would algorithm A be slower than algorithm B? Demonstrate your answer with the help of an example. Also what will the value of SUM be at the end of each algorithm if the size is set to $10'000$?

Algorithm A:

SET sum TO 0
FOR i=1 to size
  FOR j=1 to 10000
    sum=sum+1


Algorithm B:

SET sum TO 0
FOR i=1 to size
  FOR j=1 to size
    sum=sum + 1


I came up with this answer but not sure if it is correct:

The algorithm A will be slower than algorithm B when the performance of the algorithm is directly proportional to the cubed or more of the size of the input data set, for example if the Big O notation becomes $O(N^3)$ or $O(N^4)$ or $O(N^5)$ etc. The Big $O$ notation $O(N^3)$ nesting the for loops in two more for loops:

Set Sum TO 0
For i=1 to size
  For k=1 to size
    For l=1 to size
      For j=1 to 10000
sum=sum+1
Algorithm A contains an instruction that is executed $size * 10000$ times.
Algorithm B contains an instruction that is executed $size * size$ times.

It is obvious that the comparison between A and B depends on the variable size.
You can see that if $size &lt; 10000$ then B performs better, and if $size &gt; 10000$ then A performs better.
If $size = 10000$ then A and B can be considered equally fast.

It is easy to calculate the result for $sum$ when $size = 10000$.

I am not sure if it makes sense to answer with big O notation here because the algorithms are different. A computes $size * 10000$ and B computes $size^2$, which are two different algorithms; it does not make sense to compare them with big O notation in my opinion. Usually big O analysis helps in comparing algorithms that solve the same problem, which is not the case here.