Chapter 1. Introduction to Algorithms