Code credit: rosettacode.org.
I wanted to study these algorithms more closely since I felt I needed more work in this area.