Solutions to several algorithms problems.