The Design and Analysis of Computer Algorithms by Alfred V. Aho & John E. Hopcroft