How is O(N) algorithm also an O(N^2) algorithm? | Solution
"Upper bound" means the algorithm takes no longer than (i.e. <=) that long (as the input size tends to infinity, with relevant constant factors considered).
It does not mean it will ever actually take that long.
Something that's O(n) is also O(n log n), O(n2), O(n3), O(2n) and also anything else that's asymptotically bigger than n.
If you're comfortable with the relevant mathematics, you can also see this from the formal definition.

Subscribe to:
Post Comments (Atom)
Best for you
-
Error : an error occurred while making the http request to url . this could be due to the fact that the server certificate is not configu...
-
JavaScript continues to evolve, and in the latest ECMAScript proposals and releases (as of ECMAScript 2024), several enhancements have been ...
-
In Angular 17, the Signal API introduces a reactive way to manage state using signals, which can be very useful for performance and simpli...
-
For making MailWatch work with Debian 11 and PHP 8, I had Fixed few code-file to avoid error : PHP Fatal error: Array and string offset ac...
-
1. Use Refresh Tokens with Access Tokens Access tokens should be short-lived (e.g., 15 minutes). Refresh tokens should be long-liv...
-
Temporal Dead Zone is a behaviour that occurs with variables declared using let and const keywords. It is a behaviour where we try to ...
-
Q1 -- What is JavaScript? Ans--- JavaScript is a scripting language used to make the website interactive Q2 -- What is Node.js? Ans---...
-
Change permission to UPLOAD file into upload folder on UBUNTU Read + Write sudo chmod -R a+rw images/ Read + Write + Execute sudo chmod -R...
-
Functions that operate on other functions, either by taking them as arguments or by returning them, are called higher-order functions. Hig...
No comments:
Post a Comment