c.f this question on O() notation.
Stackoverflow actually has the 'homework' tag, and is willing to entertain questions of that kind. MO has strong prohibitions in place against it. The first problem here is that it's not entirely obvious that this is a homework question, and that changes my response.
- If it's not a homework question, then I'm willing to nudge the OP along in comments to find the answer themselves
- if it is, I'd rather not help.
- either way, I'm loathe to actually POST an answer, because it's a gratuitous rep honeypot, and it might only encourage more questions along these lines, and I'm not sure I want to encourage questions that are so low-level.
But I recognize that there are differences of opinion on how welcoming we should be. So what say all ?