The time complexity of this recursion function via /r/learnprogramming


The time complexity of this recursion function

It is

T(n) = 2T(n/2) + c for n > 1

I'm fairly sure this is O(lg n) but this video I'm watching has a guy saying it's O(n) which doesn't make sense to me. Which is right?

19:50 here

Submitted July 10, 2017 at 09:01PM by eatingpoopinrobarts
via reddit http://ift.tt/2sJRPuW

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s