So we're just beginning Big O notation, and we have a question asking this:
What is the worst time complexity for the following loop, if someWork
has complexity of O(i)
, noting that this means that i
is the loop counter, so the steps of someWork increases every time the counter does:
while(i < n)
someWork(...)
i <-- i + 2
This is obviously written in pseudocode, and I've gotten the easier questions, so I don't believe I have a problem understanding the question, it's this specific one that I'm stuck on. Can I get some help, please?
Thanks so much in advance!