I was trying to understand the Data Structure and different algorithm, then i got confused to measure the Bubble sort time complexity.
for (c = 0; c < ( n
O(n^2) = n(n-1)/2 is the right one.
O(n^2) = n(n-1)/2
As in the above example of 5 elements.
5(5-1)/2 == 10. 5(5+1)/2 != 10.