Is my algorithim incorrect?

Printable View