Create algorithm.txt

This is the logic of the code