Update alg1.h

had i and j swapped in yet another spot.