Big O Time

Here's a great way to approximate the Big O time of your algorithm: just run it with differently sized inputs. That's right, that's all you have to do* (*there's more to it, we'll get to it in a sec). You don't need to follow your inputs around, count any loops, look for best case and worse case scenarios. You can get a pretty good approximation by following the steps below. 1. Speed test your algorithm . Make sure you have at least 3 inputs - if you're working with an array, make sure there's 3 elements, if you have a string make sure there's at least 3 letters, etc. Larger inputs will make this test more accurate. Note down how fast your algorithm was. 2. Double the number of inputs. 3. Speed test your algorithm again. Got a number? Good. 4. Now, divide the second speed test result by the first one. Once you've got that ratio, you're good to go! Simply compare your ratio to the following chart: Ratio Big O time approximately 1 O(1)...