The Design and Analysis of Computer Algorithms