Determine the precise (i.e., not just the order of magnitude)Big-Oh values for the following code sample, based on the number ofstatement execution. Choose the answer that best agrees with thevalue you have determined. Keep the following considerations inmind:
Remember to consider each statement incompound statements separately.
Pay close attention to the initial and endvalues of loop variables!
Loops such as “for” and “while” contain animplicit “jump” instruction that causes execution to proceed fromthe end of the loop back to the beginning of the loop.
for (int i = 0; i < n; i++)
for (int j = i; j < n; j++)
sum += i;
Here are the answer choices:
O(N(N + 1) / 2)
O(4N2 + 5N + 2)
O(2N2 + 7N + 2)
O(3N^2 + 11N + 4)/2
Also, could you please include an explanation of how you arrivedat your answer? Thank you.