Access Millions of academic & study documents

An algorithm takes 2n^2 + 2^n bit operations to solve a problem of si

Content type
User Generated
Showing Page:
1/1
An algorithm takes 2n^2 + 2^n bit operations to solve a
problem of size n. Compute it running time if each
operation requires 10^-5 second and n = 20. What is the
big O notation of this algorithm?
Solution
Answer:
a. Number of operations when n=20:
=2(20^2)+2^20
= 2*400+2^20
total number of operations =1049376
total Running time of all operations: 1049376*10^-5 =>
10.49376 seconds
--------------------------------------------------------------------------
-----
b) Big o notation:
Maximum power is n^2
So, O(n^2)

Sign up to view the full document!

lock_open Sign Up
Unformatted Attachment Preview
An algorithm takes 2n^2 + 2^n bit operations to solve a problem of size n. Compute it running time if each operation requires 10^-5 second and n = 20. What is the big O notation of this algorithm? Solution Answer: a. Number of operations when n=20: =2(20^2)+2^20 = 2*400+2^20 total number of operat ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4

Similar Documents