Data structures and algorithms. - Aho, Alfred V.; Hopcroft, John E.; Ullman, Jeffrey D.