Wouldn't want you to have to run a google search or think about how algorithms might work. Shock! Horror!

This article should point you in the right directions: http://akira.ruc.dk/~keld/teaching/a...04/Huang88.pdf