List of heirs to the Danish throne Wikipedia
Although the monarchy was elective during this time period, succession following Christian I of Denmark (with one exception of a forced abdication) followed Salic law.
Frederick III adopted a Semi-salic law of succession.
With both Frederick VII and his uncle, Ferdinand childless, legislation was passed in 1852 to give the Danish throne to Christian of Schleswig-Holstein-Sonderburg-Glücksburg, a great-grandson of Frederick V. Semi-salic law continued to be used until 1953 when male-preference primogeniture was adopted. This lasted until 2009 when absolute primogeniture was put in place.