Pattern matching
Introduction to Algorithms