Algorithms of algorithms


Suppose that N equals 1 million. Approximately how much faster is an algorithm that performs Nlg⁡N operations versus one that performs N2 operations? Recall that lg is the base-2 logarithm function.
N2/(Nlg⁡N)=N/lg⁡N=1,000,000/lg⁡(1,000,000). Since 220 is approximately 1 million, we obtain approximately 50,000.

View original post

About Khuram Ali

Programming... Programming and Programming...!!!

Posted on September 30, 2013, in Algorithms and tagged . Bookmark the permalink. Leave a comment.

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: