tailieunhanh - Algorithms Herbert S Notice Copyright 1994 by Herbert S. Wilf

The defining feature of modern computers which distinguishes them from all other machines is that they can be programmed. That is to say that some type of instructions (the program) can be given to the computer, and it will process them. Modern computers based on the von Neumann architecture often have machine code in the form of an imperative programming language. | Algorithms and Complexity Herbert S. Wilf University of Pennsylvania Philadelphia PA 19104-6395 Copyright Notice Copyright 1994 by Herbert S. Wilf. This material may be reproduced for any educational purpose multiple copies may be made for classes etc. Charges if any for reproduced copies must be just enough to recover reasonable costs of reproduction. Reproduction for commercial purposes is prohibited. This cover page must be included in all distributed copies. Internet Edition Summer 1994 This edition of Algorithms and Complexity is available at the web site http www wilf . It may be taken at no charge by all interested persons. Comments and corrections are welcome and should be sent to wilf@ A Second Edition of this book was published in 2003 and can be purchased now. The Second Edition contains solutions to most of the exercises. CONTENTS Chapter 0 What This Book Is About Hard vs. easy A Chapter 1 Mathematical Preliminaries Orders of magnitude .5 Positional number systems. 11 Manipulations with series . 14 Recurrence relations. 16 Counting . 21 Graphs . 24 Chapter 2 Recursive Algorithms Introduction. 30 Quicksort . 31 Recursive graph algorithms. 38 Fast matrix multiplication. 47 The discrete Fourier transform. 50 Applications of the FFT. 56 A review. 60 Chapter 3 The Network Flow Problem Introduction. 63 Algorithms for the network flow problem. 64 The algorithm of Ford and Fulkerson . 65 The max-flow min-cut theorem. 69 The complexity of the Ford-Fulkerson algorithm . 70 Layered networks. 72 The MPM Algorithm. 76 Applications of network flow . 77 Chapter 4 Algorithms in the Theory of Numbers Preliminaries . 81 The greatest common divisor . 82 The extended Euclidean algorithm . 85 Primality testing . 87 Interlude the ring of integers modulo n. 89 Pseudoprimality tests . 92 Proof