Denmark is tiny and flat and mechanized German troops could and did take meaningful control of the country in a matter of hours.
Norway is really mostly tiny towns dotted along a coast of impassable mountains. So taking control of the whole country isn't really required, but any transport has to happen by sea. (and the British successfully attacked nazi ships in the North Sea)
...which is why the nazis desperately needed Sweden and it's rail to transport troops and resources. But that rail is laid out over the full length of Sweden, a vast, vast area, that the nazis could never hope to meaningfully and safely control. The rail would have been easy to attack or disrupt even without a huge army of conventional troops and the Swedes could have done that, but they didn't.
/The Expert - I'll have you know I was a four star general during WW2 (or at least I used to play Hidden and Dangerous and Close Combat 2 on PC), AMA
And the Swedes did not attack German train transports because the traffic was according to a pass-through agreement.
USSR and Germany forced these pass-through agreements after Winter War. USSR was in pact with Germany, and both acquired permission to transit troops to their bases, Soviets to Hanko (Hangö) that it took in Winter War, and Germany to northern Norway which it took in April-June 1940. Sweden was surrounded from three sides by Germany, and in the fourth side was Finland badly weakened by Soviets attacking, with increasing Soviet pressure also after Winter War.
Norway is really mostly tiny towns dotted along a coast of impassable mountains. So taking control of the whole country isn't really required, but any transport has to happen by sea. (and the British successfully attacked nazi ships in the North Sea)
...which is why the nazis desperately needed Sweden and it's rail to transport troops and resources. But that rail is laid out over the full length of Sweden, a vast, vast area, that the nazis could never hope to meaningfully and safely control. The rail would have been easy to attack or disrupt even without a huge army of conventional troops and the Swedes could have done that, but they didn't.
/The Expert - I'll have you know I was a four star general during WW2 (or at least I used to play Hidden and Dangerous and Close Combat 2 on PC), AMA
:P