Number of Comparisions (II)Computer Science Level 2
Find the number of comparisons done in the following algorithm.
1 2 3 4 5 6 7
Assumptions and Details
- \(n\) is a non-negative integer.
- Don't count any comparison made by the for loop itself (i.e. whether or not to proceed with another loop).