Re:A Gentle Introduction to Algorithm Complexity Analysis
by strainer on Friday June 15, 2018 @08:56AM
(#17319403)
for ( var i=0; i<n; ++i ) {..
In Javascript this will loop from 0 to n-1 inclusive regardless of using ++i or i++, because that loop 'stepping statement' happens after the loop body.
Its possible to combine the step in the test to go from 1 to n-1
Its possible to combine the step in the test to go from 1 to n-1
best to be aware of the quirk and just do