educative.io

Amortized Analysis - Competitive Programming in C++: The Keys to Success

here I don’t get how you get that logN complexity and what I get is if we copy the array of size 10 and 100000 both have the same time complexity of O[N] but 2nd one will consume more time. right ?

logN complexity is because of the reason that every time when outer loop is executed ,var gets doubled. So count of running outer loop is 4. Since value of n is 10 so logN(10) becomes ~4.
As far as about copying the array, its time complexity is O(N). But if you say an array is of size 10 and other one is of 100000, then definitely second one will consume more time but the point here is that its time complexity is completely depending on N i.e. its size.