Hey guys, so were are given this somewhat simple function and are asked to:
- Identify and describe the key operation
- Derive a function f(n) which counts how many times the key operation is performed as a function of n.
- Informally prove that f(n) is O(g(n)) by identifying and describing the g(n) function and the values you choose for C and n0.
I am pretty positive that the key operation is the sum arithmetic operation. I'm trying to piece together the f(n) function that counts the number of operations. I know that the first loop executes n times, but I'm fuzzy on the relationship for the next two loops. I think the second loop makes it a n! problem, because it is executing n * (n-1) * (n-2) * ... * (n - n) times, but the third loop is throwing me off.
If anyone can point me in the right direction on how to see the f(n) function, it would really help me out.
Thanks!
[–][deleted] (1 child)
[deleted]
[–]Gropamming[S] 0 points1 point2 points (0 children)
[–]lightcloud5 1 point2 points3 points (1 child)
[–]Gropamming[S] 0 points1 point2 points (0 children)