vendredi 27 décembre 2019

What is the time complexity of inserting elements of an array into a map?

If inserting an element takes log(N) time in a map, where N is the size of the map. Then inserting elements of the array one by one means log(1)+log(2)+....+log(N) = log(N!) complexity. But the normal best complexity for getting the elements sorted is Nlog(N), Where am I going wrong?

Aucun commentaire:

Enregistrer un commentaire