Answer : (d) I > III > II > IV
Piperidine and morpholine both are non-aromatic and N-atom is sp3 hybridised in them, so these are more basic as compared to other two (which are aromatic and have sp2 hybridised N-atom).
-I-effect of O-atom in morpholine makes it less basic as compared to piperidine.
Now,
Out of pyridine and pyrolle, pyridine is much stronger base as the lone pair of nitrogen atom in pyridine is not involved in resonance.
So,
The order of basic strength is :
I > III > II > IV.