Algorithms from book "Introduction to Theoretical Computer Science / matfyzpress"  revrites to Python