The specific heat of a substance depends on its molecular structure because the way molecules interact with each other determines how much heat energy is required to raise the temperature of the substance by a certain amount. Substances with more complex molecular structures may have more ways to store and transfer thermal energy, affecting the amount of energy needed for a temperature change. For example, in solids, the atomic or molecular vibrations (phonons) and bonds between molecules play a role in specific heat. In liquids and gases, the freedom of movement and interactions between molecules also influence the specific heat.
Hence, the correct answer is (d).