Math, asked by celestiaSangma4553, 1 year ago

if algorithm a has running time 9n^2+3n+3 and algorithm b has running time 7n^2 then

Answers

Answered by Spartan3338
0
what is the question???
Answered by vinod04jangid
0

Answer:

Time complexity of both the algorithms are equal i.e. O(n^{2}).

Step-by-step explanation:

Given:- An algorithm a has a running time of 9n^{2} + 3n +3 and b has running time 7n^{2}.

Solution:-

Time Complexity means the amount of time taken by an algorithm to run all its iterations.

Asymptotic Notation is a means to describe the running time of an algorithm. There are three different notations: Big Oh (O), Big Theta (Θ), and Big Omega (Ω).

Algorithm a has running time of  9n^{2} + 3n +3.

Algorithm b has running time of 7n^{2}.

While calculating time complexity, only the highest order term is considered whereas all the lower order terms are discarded.

∴ Time complexity of algorithm a is O(n^{2}), and

Time complexity of algorithm b is also O(n^{2}).

Therefore, if algorithm a has running time 9n^{2} + 3n +3 and algorithm b has running time 7n^{2} then time complexity of both the algorithms are equal i.e. O(n^{2}).

#SPJ3

Similar questions