What historical event directly led to the end of available frontier lands for settlement?

AHomestead Act of 1862

B1849 Gold Rush

COklahoma Land Rush

DRailroad Act of 1862