How big can n be
transcript
One second. A hundred million steps. How large can n be? It depends on the class.
A linear method reaches a hundred million. N log n reaches four and a half million. Both are comfortable for big inputs. Log n handles anything.
N squared reaches only ten thousand. N cubed reaches four hundred sixty four. Two to the n reaches twenty six. Tiny inputs only.
On one laptop, Python did about fifty million steps a second. JavaScript did about a billion. Compiled code did a little over a billion. The class stays the same.
The language moves the limit. In Python, n squared fits about seven thousand items. Compiled, it fits about thirty five thousand. A constant factor, not a new class.
More time helps less than you think. Ten times the budget, three times the n for squared. A better class helps far more. Change the method first.
Divide the budget by steps. The class tells you the largest n. Check it against your real size. Then choose the method.
The class sets the limit. Full breakdown in the lecture.