Spectral partitions for Sturm–Liouville problems