Understanding the Basics of Algorithms