###0

The original paper by Needleman and Wunsch is actually a very informal description of the algorithm. It uses an arbitrary scoring function for gaps, which leads to an algorithm of runtime O(n^3). Read the full description in Systematic Dynamic Programming in Bioinformatics.