Can anyone exactly tell that how do we decide the complexity in this case.
like nlogn +n , then the overall complexity is ?
like, if O(f(n)+g(n)) can be equal to max(f(n),g(n)) ? Can we say this ? thanks

like nlogn +n , then the overall complexity is ?

nlogn, because for the most part, insignificant factors are ignored. nlogn overwhelms n, so n is tossed away.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.