How was segregation in public places made legal?

A. the Reconstruction Acts
B. Black codes
C. head and master laws
D. Jim Crow laws