Princeton's Algorithms, Part I. Except in C, not Java.