Most Carex have both sexes on the same plant, but in many different arrangements. Some are on separate spikes, some the same. If the same, they are variously arranged. In any case it all works. This image shows the pistillate
spikes of stiff sedge that appears below the terminal staminate spike.