didn‘t need to do里need是普通动词,就是need本来的意思,(过去)没必要/不需要做某事
need not have done 里need是情态动词,意思是本来无必要做某事(却做了),本不该做某事
例如:
He did not need to come early,so he came late.
他不需要早来,所以他来得晚.
He needn't have come early,but he did and waited one hour.
他不需要早来却早来了,还等了一个小时.