In class, simple sort is used as like one of our first definitions of O(N) runtimes…
But since it goes through one less iteration of the array every time it runs, wouldn’t it be something more along the lines of…
Runtime bubble= sum(i = 0, n, (n-i)) ?
And aren’t only the biggest processes when run one after another counted in asymptotic analysis which would be the N iteration, why is by definition this sort not O(N)?
The sum of
1 + 2 + ... + NisN*(N+1)/2… (high school maths) … and that approaches(N^2)/2asNgoes to infinity. ClassicO(N^2).