Suppose we are using a set ( it can be multiset if there are duplicate values), as we know insertion in a set is log(n) time where n is the current length of the set, so if we insert n elements in a set then overall complexity will look like log1+log2+log3…log(n). We can surely say that it is less than log(n)+log(n)…log(n)=nlog(n), can anyone tell where I am doing wrong?

I know its quite late to reply as I saw the question now itself, but in a set the insertion is always log(n) not nlogn cause mostly we would be using a hash tree or a red-black tree, n insertions doesn’t create a difference.