I'm trying to understand the algorithm for insert sort for efficiency.
Why does 2 + 2 x 2 + .... 2 X(n-1) = n squared - n?
what's the relationship between the two?
thanks.
Type: Posts; User: Alysosh
I'm trying to understand the algorithm for insert sort for efficiency.
Why does 2 + 2 x 2 + .... 2 X(n-1) = n squared - n?
what's the relationship between the two?
thanks.
I'm trying to read in a .java file then output it with highlighted keywords etc. as an HTML file. I obvoiusly want to keep the formating but don't know how to use Scanner to return the whitspace...