HOW TO THINK ABOUT ALGORITHMS
There are many algorithm texts that provide lots of well-polished code and
proofs of correctness. Instead, this one presents insights, notations, and
analogies to help the novice describe and think about algorithms like an
expert. It is a bit like a carpenter studying hammers instead of houses. Jeff
Edmonds provides both the big picture and easy step-by-step methods for
developing algorithms, while avoiding the comon pitfalls. Paradigms such
as loop invariants and recursion help to unify a huge range of algorithms
into a few meta-algorithms. Part of the goal is to teach students to think
abstractly. Without getting bogged down in formal proofs, the book fosters
deeper understanding so that how and why each algorithm works is trans-
parent. These insights are presented in a slow and clear manner accessible
to second- or third-year students of computer science, preparing them to
find on their own innovative ways to solve problems.
Abstraction is when you translate the equations, the rules, and the under-
lying essences of the problem not only into a language that can be commu-
nicated to your friend standing with you on a streetcar, but also into a form
that can percolate down and dwell in your subconscious. Because, remem-
ber, it is your subconscious that makes the miraculous leaps of inspiration,
not your plodding perspiration and not your cocky logic. And remember,
unlike you, your subconscious does not understand Java code.
Bookmarks
Cover
Half-title
Title
Copyright
CONTENTS
PREFACE
Introduction
PART ONE:Iterative Algorithms and Loop Invariants
1 Iterative Algorithms: Measures of Progress and Loop Invariants
1.1 A Paradigm Shift: A Sequence of Actions vs. a Sequence of Assertions
1.2 The Steps to Develop an Iterative Algorithm
1.3 More about the Steps
1.4 Different Types of Iterative Algorithms
1.5 Typical Errors
1.6 Exercises
2 Examples Using More-of-the-Input Loop Invariants
2.1 Coloring the Plane
2.2 Deterministic Finite Automaton
2.3 More of the Input vs. More of the Output
3 Abstract Data Types
3.1 Specifications and Hints at Implementations
3.2 Link List Implementation
3.3 Merging with a Queue
3.4 Parsing with a Stack
4 Narrowing the Search Space: Binary Search
4.1 Binary Search Trees
4.2 Magic Sevens
4.3 VLSI Chip Testing
4.4 Exercises
5 Iterative Sorting Algorithms
5.1 Bucket Sort by Hand
5.2 Counting Sort (a Stable Sort)
5.3 Radix Sort
5.4 Radix Counting Sort
6 Euclid’s GCD Algorithm
7 The Loop Invariant for Lower Bounds
PART TWO: Recursion
8 Abstractions, Techniques, and Theory
8.1 Thinking about Recursion
8.2 Looking Forward vs. Backward
8.3 With a Little Help from Your Friends
8.4 The Towers of Hanoi
8.5 Checklist for Recursive Algorithms
8.6 The Stack Frame
8.7 Proving Correctness with Strong Induction
9 Some Simple Examples of Recursive Algorithms
9.1 Sorting and Selecting Algorithms
9.2 Operations on Integers
9.3 Ackermann's Function
9.4 Exercises
10 Recursion on Trees
10.1 Tree Traversals
10.2 Simple Examples
10.3 Generalizing the Problem Solved
10.4 Heap Sort and Priority Queues
10.5 Representing Expressions with Trees
11 Recursive Images
11.1 Drawing a Recursive Image from a Fixed Recursive and a Base Case Image
11.2 Randomly Generating a Maze
12 Parsing with Context-Free Grammars
PART THREE: Optimization Problems
13 Definition of Optimization Problems
14 Graph Search Algorithms
14.1 A Generic Search Algorithm
14.2 Breadth-First Search for Shortest Paths
14.3 Dijkstra's Shortest-Weighted-Path Algorithm
14.4 Depth-First Search
14.5 Recursive Depth-First Search
14.6 Linear Ordering of a Partial Order
14.7 Exercise
15 Network Flows and Linear Programming
15.1 A Hill-Climbing Algorithm with a Small Local Maximum
15.2 The Primal…Dual Hill-Climbing Method
15.3 The Steepest-Ascent Hill-Climbing Algorithm
15.4 Linear Programming
15.5 Exercises
16 Greedy Algorithms
16.1 Abstractions, Techniques, and Theory
16.2 Examples of Greedy Algorithms 16.2.1 Example: The Job/Event Scheduling Problem
16.2.2 Example: The Interval Cover Problem
16.2.3 Example: The Minimum-Spanning-Tree Problem
16.3 Exercises
17 Recursive Backtracking
17.1 Recursive Backtracking Algorithms
17.2 The Steps in Developing a Recursive Backtracking
17.3 Pruning Branches
17.4 Satisfiability
17.5 Exercises
18 Dynamic Programming Algorithms
18.1 Start by Developing a Recursive Backtracking
18.2 The Steps in Developing a Dynamic Programming Algorithm
18.3 Subtle Points
18.3.1 The Question for the Little Bird
18.3.2 Subinstances and Subsolutions
18.3.3 The Set of Subinstances
18.3.4 Decreasing Time and Space
18.3.5 Counting the Number of Solutions
18.3.6 The New Code
19 Examples of Dynamic Programs
19.1 The Longest-Common-Subsequence Problem
19.2 Dynamic Programs as More-of-the-Input Iterative Loop Invariant Algorithms
19.3 A Greedy Dynamic Program: The Weighted Job/Event Scheduling Problem
19.4 The Solution Viewed as a Tree: Chains of Matrix Multiplications
19.5 Generalizing the Problem Solved: Best AVL Tree
19.6 All Pairs Using Matrix Multiplication
19.7 Parsing with Context-Free Grammars
19.8 Designing Dynamic Programming Algorithms via Reductions
20 Reductions and NP-Completeness
20.1 Satisfiability Is at Least as Hard as Any Optimization Problem
20.2 Steps to Prove NP-Completeness
20.3 Example: 3-Coloring Is NP-Complete
20.4 An Algorithm for Bipartite Matching Using the Network Flow Algorithm
21 Randomized Algorithms
21.1 Using Randomness to Hide the Worst Cases
21.2 Solutions of Optimization Problems with a Random Structure
PART FOUR: Appendix
22 Existential and Universal Quantifiers
23 Time Complexity
23.1 The Time (and Space) Complexity of an Algorithm
23.2 The Time Complexity of a Computational Problem
24 Logarithms and Exponentials
25 Asymptotic Growth
25.1 Steps to Classify a Function
25.2 More about Asymptotic Notation
26 Adding-Made-Easy Approximations
26.1 The Technique
26.2 Some Proofs for the Adding-Made-Easy Technique
27 Recurrence Relations
27.1 The Technique
27.2 Some Proofs
28 A Formal Proof of Correctness
PART FIVE: Exercise Solutions
Chapter 1. Iterative Algorithms: Measures of Progress and Loop Invariants
Chapter 2. Examples UsingMore-of-the-Input Loop Invariant
Chapter 3. Abstract Data Types
Chapter 4. Narrowing the Search Space: Binary Search
Chapter 6. Euclid’s GCD Algorithm
Chapter 7. The Loop Invariant for Lower Bounds
Chapter 8. Abstractions, Techniques, and Theory
Chapter 9. Some Simple Examples of Recursive Algorithms
Chapter 10. Recursion on Trees
Chapter 11. Recursive Images
Chapter 12. Parsingwith Context-Free Grammars
Chapter 14. Graph Search Algorithms
Chapter 15. Network Flows and Linear Programming
Chapter 16: Greedy Algorithms
Chapter 17. Recursive Backtracking
Chapter 18. Dynamic Programming Algorithms
Chapter 19. Examples of Dynamic Programs
Chapter 20. Reductions and NP-Completeness
Chapter 22. Existential and Universal Quantifiers
Chapter 23. Time Complexity
Chapter 24. Logarithms and Exponentials
Chapter 25. Asymptotic Growth
Chapter 26. Adding-Made-Easy Approximations
Chapter 27. Recurrence Relations
CONCLUSION
INDEX
Jeff Edmonds received his Ph.D. in 1992 at University of Toronto in theoretical computer science. His thesis proved that certain computation problems require a given amount of time and space. He did his postdoctorate work at the ICSI in Berkeley on secure multi-media data transmission and in 1995 became an Associate Professor in the Department of Computer Science at York Univer...
(展开全部)
1944年12月,就在二战行将结束之际,希特勒又一次令世界震惊:德军从比利时和卢森堡东部林木茂盛的阿登山区发起了一次强有力的反击,并在盟军战线上形成了50英里的...
内科急症临床护理 本书特色 急症护理是护理学的重要组成部分,面对急危重病人,能否及时无误地作出诊断和护理,直接关系着患者的安危和抢救的成败。为此,要求护士能熟练...
近现代25位中医名家妇科经验 本书特色 《近现代25位中医名家妇科经验》由丛春雨编著,重点介绍了名家生平简介(包括学医成才之路及学术业绩)、学术思想特点...
绘者简介:I.N.J.卡尔巴德,英国著名漫画家、作家、动画导演。起初卡尔巴德是以动画设计师的身份开始的职业生涯,2006年,他在成千上万名漫画家中脱颖而出,将作...
《七月与安生》是庆山最新短篇小说集,从安妮宝贝到庆山,20年来备受读者追捧和惦念的12个短篇故事,呈现青春、流浪和宿命,是那些你会放在枕边独自思量的故事。所选篇...
为什么标价9.9元一定比标价10元的商品卖得火?为什么热情推销的销售人员,反而不如让消费者自由选购商品的销售人员业绩好?为什么喝彩的只是看客,挑剔的却成了买家?...
《厨房》——作者的成名作。少女樱井美影失去所有亲人后,只有在厨房的冰箱旁才能安睡,这时,曾受她祖母关照的田边雄一与他的变性人母亲惠理子收留了她,这个病态家庭却使...
这是地下丝绒乐队(Velvet Underground)的主唱兼吉他手,Lou Reed 所创作的摇滚歌词集,分中文、英文两册,中文黑纸印银,英文牛皮纸印黑,裸...
现代食品微生物学实验技术 内容简介 现代食品微生物学实验技术-北京市高等教育精品教材>配套实验教材现代食品微生物学实验技术 目录 食品微生物学实验室守则**篇 ...
伤寒论 本书特色 伤寒论 东汉张仲景所著,六经辨证体系的始祖。东汉张仲景所著,六经辨证体系的始祖。张仲景原著《伤寒杂病论》,在流传的过程中,经后人整理编纂将其中...
李泽厚(1930-) 美学家。长沙宁乡人。1948年毕业于湖南省立第一师范。1955年毕业于北京大学哲学系,旋在中国社会科学院哲学研究所任职,1978年起任研究...
佐织已经失踪三年了。她曾是我们小镇很受欢迎的女孩,人长得漂亮,歌唱得也好听。我们看着她一天天长大,视她若珍宝。可即将出道成为歌手时,她突然失踪了。漫长的等待,我...
明清之際江南常熟藏書家錢曾(字遵王,自號也是翁,1629-1701)於目錄、版本學上之貢獻世所習知,惟錢氏亦詩人,為錢謙益虞山詩派重要成員,得謙益真傳,有名於時...
作品目录SCENE10 绝佳的暗处VISCENE11 绝佳的暗处VIISCENE12 微笑的泰莉莎ISCENE13 微笑的泰莉莎IISCENE14 微笑的泰莉莎...
Wardemandsthatscholarsandpolicymakersusevictoryinpreciseandcoherenttermstocommun...
冯唐成事学全新力作,半生读书、写作、成事经验,对话50部传世经典,带你看到历经时间的方法。求真实,不糊涂,才能多成事;读明白了,活明白了,才是真的了不起。《了不...
无可争议的侦探小说女王,侦探文学史上最伟大的作家之一。阿加莎•克里斯蒂原名为阿加莎•玛丽•克拉丽莎•米勒,一八九○年九月十五日生于英国德文郡托基的阿什菲尔德宅邸...
【编辑推荐】知名财经作者吴晓波新作,畅销十年、销量超过两百万册的《激荡三十年》续篇,至此完成改革开放四十年企业史完整记录。作为时代记录者,吴晓波有意识地从197...
瑪格麗特.魏絲(Margaret Weis),1970年畢業於密蘇里州大學,主修創作與文學。目前為自由作家,與丈夫共同創作奇幻與科幻類型的小說。夫婦倆現在快樂地...
克里希那穆提(1895-1986),印度著名哲学家,当代最受推崇的心灵导师,已出版七十余本著作,全部由演讲和对话录集结而成,目前已被译成47国语言文字,在全世界...