The classic Internet of Things-Cloud Computing model faces challenges like high response latency, high bandwidth consumption, and high storage requirement with increasing velocity and volume of generated data. Fog computing offers better services to end users by bringing processing, storage, and networking closer to them. Recently, there has been significant research addressing architectural and algorithmic aspects of fog computing. In the existing literature, a systematic study of architectural designs is widely conducted for various applications. Algorithms are seldom examined. Algorithms play a crucial role in fog computing. This survey aims to performing a comparative study of existing algorithms. The study also presents a systematic classification of the current fog computing algorithms and highlights the key challenges and research issues associated with them.