Ghost imaging and single-pixel imaging originate from different physical concepts. They have been closely integrated and developed together due to many similarities they share in the system schemes and image reconstruction algorithms. As typical computational imaging technologies, these two imaging schemes have received extensive attention in the fields of optics, imaging, and information acquisition. Different from traditional area array imaging, ghost imaging and single-pixel imaging obtain images by using the reconstruction algorithms, which is one important feature of computational imaging. In this paper, the history of ghost imaging and single-pixel imaging is briefly reviewed with a focus on typical image reconstruction algorithms. The principles of ghost imaging and single-pixel imaging using light field second-order correlation, sampling theory, compressed sensing, and machine learning are explained. Their application potential and prospects are discussed.