Fundamental algorithms - Knuth, Donald E. (Addison-Wesley series in computer science and information processing, 1973)