Python Algorithms: Mastering Basic Algorithms in the Python Language
Author: Magnus Lie Hetland
Copyright © 2010
ISBN-13 (pbk): 978-1-4302-3237-7
ISBN-13 (electronic): 978-1-4302-3238-4
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Contents...................................................................................................................vi
About the Author ...................................................................................................xiii
About the Technical Reviewer ............................................................................... xiv
Acknowledgments .................................................................................................. xv
Preface .................................................................................................................. xvi
■ Chapter 1: Introduction........................................................................................1
■ Chapter 2: The Basics ..........................................................................................9
■ Chapter 3: Counting 101 ....................................................................................45
■ Chapter 4: Induction and Recursion … and Reduction......................................71
■ Chapter 5: Traversal: The Skeleton Key of Algorithmics .................................101
■ Chapter 6: Divide, Combine, and Conquer........................................................125
■ Chapter 7: Greed Is Good? Prove It!.................................................................151
■ Chapter 8: Tangled Dependencies and Memoization .......................................175
■ Chapter 9: From A to B with Edsger and Friends.............................................199
■ Chapter 10: Matchings, Cuts, and Flows .........................................................221
■ Chapter 11: Hard Problems and (Limited) Sloppiness .....................................241
■ Appendix A: Pedal to the Metal: Accelerating Python .....................................271
■ Appendix B: List of Problems and Algorithms .................................................275
■ Appendix C: Graph Terminology.......................................................................285
■ Appendix D: Hints for Exercises.......................................................................291
■ Index ................................................................................................................307
附件列表