CS 240: updated algorithms to use algorithms2e environment.