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.
That the time (or space) the algorithm requires is linear with relation to the number of elements being processed. For every x inputs you have to perform some multiple of x operations. If you have 1,000,000 inputs then it should take roughly 1,000 times as long as if you have 1,000 inputs. O(N2) means the time it takes increases exponentially with the number of inputs, so 1,000,000 inputs might take 1,000,000 times as long as 1,000 inputs.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Lonely Integer
You are viewing a single comment's thread. Return to all comments →
That the time (or space) the algorithm requires is linear with relation to the number of elements being processed. For every x inputs you have to perform some multiple of x operations. If you have 1,000,000 inputs then it should take roughly 1,000 times as long as if you have 1,000 inputs. O(N2) means the time it takes increases exponentially with the number of inputs, so 1,000,000 inputs might take 1,000,000 times as long as 1,000 inputs.