Original Post
I've been trying to better my computer science background for the past year or so, but I've come up against this paradox in my thinking.
void Foo(int Input)
{
for (int i = Input; i < Input; ++i);
}
This is O(n) time, right?
void Bar(int Input)
{
for (int i = Input; i < Input; ++i);
for (int i = Input; i < Input; ++i);
}
... Now, this is where my question comes in. This performs 2n operations. However, the 2 coefficient is equivalent (right? If not, then this answers my question) to simply doubling the constant. This makes it O(n) time, then. However, if both of those are O(n) time, what notation makes clear the fact that Bar is provably twice as complex as Foo assuming each is given any particular input? Or have I made an error in my thinking?