We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Those kinds of differences aren't as big (and therefore as consequential) as exponential or logarithmic, which is what programmers use to define time complexity. Therefore, we don't care if the time it takes is 4 times the length of the list or 2 times the length of the list, but rather if it is O(n^2) or (e^n), where n is the length of the list. And even if the time complexity is O(b*(n^2)) or O(c*(n^2)), where b and c are constants, we don't care, we simply put it as O(n^2). We care more about that than comparing your "best case" scenario to his "worse case" scenario.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →
Those kinds of differences aren't as big (and therefore as consequential) as exponential or logarithmic, which is what programmers use to define time complexity. Therefore, we don't care if the time it takes is 4 times the length of the list or 2 times the length of the list, but rather if it is O(n^2) or (e^n), where n is the length of the list. And even if the time complexity is O(b*(n^2)) or O(c*(n^2)), where b and c are constants, we don't care, we simply put it as O(n^2). We care more about that than comparing your "best case" scenario to his "worse case" scenario.