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