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...
(展开全部)
米兰·昆德拉(1929-),捷克人。当过工人、爵士乐手,后创作文学和电影,60年代末苏联出兵布拉格,其作品遭查禁。1979年后移居法国,曾多次获国际性文学大奖,...
作品目录第一讲 关于空间 居住和建造建筑赋予空间以秩序,人类通过空间形成秩序关于建筑的本质是避难所的错误认识家是世界的模型
作品目录屋根裏の散歩者/江戸川乱歩痴人の復讐/小酒井不木街角の文字/本田緒生煙突奇談/地味井平造五体の積木/岡戸武平蜘蛛
作品目录西晋户调式的意义 北魏均田制中的几个问题 魏、晋至唐官府作场及官府工程的工匠 南朝寒人的兴起 南北朝后期科举制度的萌
于康著名临床营养学专家,北京协和医院营养科主任医师、教授、博士研究生导师。《养生堂》人气嘉宾。中国营养学会理事兼科普委员会副主委,中国老年医学会营养与食品安全分...
本书叙述了槟榔这种小小的青色果子在世界范围内如何倾倒众生,着重梳理了它在中国两千年来几起几落的流行史,并揭示出其背后社会与文化的种种变迁。青年学者曹雨结合历史文...
張小嫻全世界華人的愛情知己。她以小說描繪愛情的灼熱與冷卻,以散文傾訴戀人的微笑與淚水,至今已出版超過四十本小說和散文集。她對人性的洞察,使她開創了一種既溫柔又犀...
亚历山大·麦肯德里克( Alexander Mackendrick)投身影业二十余载,曾担任《成功的滋味》、原版《贼博士》等经典影片的编剧、故事板编辑或导演。此...
《星新一少年科幻》是日本科幻之父星新一的科幻短篇精选集,各分册是《情感电视机》《梦之城》《妄想银行》《淘气的机器人》《你好,地球人》,除了收录作者各个时期的代表...
德国政体教程 本书特色 本书以“德国问题”为线索,从多方面入手,全面地论述了德国的政府体制,力图给读者一个完整的概貌。 作者在占有大量国内外原始资料,尤其是许多...
1939年,德国潜艇U-47偷袭英国皇家海军基地斯卡帕湾,击沉“皇家橡树号”战列舰,由此拉开了第二次世界大战的海战序幕。1930年,英、美、日、意、法五个主要海...
新编南北经验医方大成-方书-23 本书特色 《新编南北经验医方大成》是元末明初医家熊鉴于元至正三年(1343)元孙允贤《医方集成》基础上增订而成。《新编南北经验...
王国斌临床经验精粹 本书特色 《王国斌临证经验精粹》是在王国斌教授从医就教 40 年之际, 师生一道总结而成, 《王国斌临证经验精粹》共分为三部分: **部分为...
李水城。1978年考入北京大学历史系,先后获学士(1982)、硕士(1988)和博士(1996)学位。曾在宾夕法尼亚大学(1999)、哈佛大学(2000、201...
柏拉图( 约公元前426年—公元前347年),古希腊哲学家,也是西方文化中最伟大的思想家和哲学家之一。译者:王太庆,著名翻译家。
江南,男,安徽合肥人。目前的身份是作家和媒体经理。代表作品有《此间的少年》、《一千零一夜之死神》、《九州·缥缈录》系列、《光明皇帝》系列等。
经济法配套辅导% 内容简介 法学的每一个知识点都是一颗珍珠,而“矢口识结构图’’则是串起这些珍珠的线。该图表力求知识点的体系结构完整,层次清晰;我们的“重点阐释...
郭敬明作家,编剧,导演,国际版权出品人,上海最世文化发展有限公司董事长、总经理,《最小说》杂志主编,《文艺风象》《文艺风赏》杂志出品人,长江文艺出版社北京图书中...
编辑推荐:◎包括婴幼儿、青少年、成年、中老年各个年龄层的突发疾病和意外状况急救方法,文字+图示,可操作性强。◎作者贾大成为北京急救中心资深专家,拥有50年急救经...
Ben Forta拥有三十多年的计算机领域从业经验,是世界知名的技术作家,也是Adobe技术界知名专家,目前担任Adobe公司的客户培训部高级主管。他撰写的《S...