[Solved] Why efficiency of selection sort or Bubble or Insertion sort is said to be n^2 and not as n(n-1)/2


In big-O notation only the most significant term counts, and constant coefficients are ignored:

O[n(n-1)/2] = O[n²/2 + n/2] = O[n²/2] = O(n²)

2

solved Why efficiency of selection sort or Bubble or Insertion sort is said to be n^2 and not as n(n-1)/2