I is most basic, because the lone pair of nitrogen is not delocalised by resonance in that, but in all others, there is resonance with benzene ring. Ill is more basic than II due to +R (or +M) effect of CH3,and IV is less basic than II because of −R (or −M)effect of —NO2, i.e. correct order is I>III>II>IV.