Preparation and characterization of CdS thin films