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...
(展开全部)
临床药学 节选 治疗的一般原则 疾病的治疗应选择*合适的治疗方法,必要时联合多种治疗手段,但药物仍是内科常见病、多发病的主要治疗手段和基础治疗。新的高效和...
中国飞行 本书特色 无与伦比、弥足珍贵的20世纪30年代的中国航拍图片;作者系德国汉莎航空公司在中国飞行的首批飞行员之一;再现了20世纪30年代的中国从南至北的...
C.J.斯库斯(C.J.Skuse)英国多产女作家,拥有创意写作和儿童文学创作的一级学位。现任英国巴斯斯巴大学儿童文学创作课程老师,并在此攻读博士学位。迄今已出...
这本书里面的短篇大多出自其名作《磨坊书简》,战争题材的《星期一的故事》也挑选了几篇作为代表。《方妮》和《萨芙》,是一篇极其优美的爱情小说。故事说的是一个从外省来...
几米1958年11月15日生于台湾宜兰,现住在台北市罗斯福路六段142巷20弄2-3号。文化大学美术系毕业,曾在广告公司工作十二年,后来为报纸、杂志等各种出版品...
Umberto Eco翁贝托•埃科(1932-2016)欧洲重要的公共知识分子,小说家、符号学家、美学家、史学家、哲学家。 出生于意大利亚历山德里亚,博洛尼亚大...
新编颈椎病学 本书特色 《新编颈椎病学》共22章,100余幅图,图文并茂。《新编颈椎病学》收集了作者马奎云、孙孝先多年的潜心研究与临床经验和国内外*新成果,内容...
森村诚一,1933年生于日本琦玉县,父亲是个商人。他从中学到大学,一帆风顺。1958年毕业于青山学院英美文学系。他是英语科班出身,对欧美小说读得甚多。他最崇拜的...
成公亮,1940年8月27日出生于江苏省宜兴县;1960年毕业于上海音乐学院附中高中部古琴专业;1965年毕业于上海音乐学院民族音乐理论作曲系;文革期间在北京中...
专科专病名医临证实录丛书:围绝经期综合症 本书特色 《专科专病名医临证实录丛书:围绝经期综合征》是国家中医药管理局为贯彻国家卫生政策,提高中医药临床疗效,发展中...
王莹,女,1982年生,历史学博士,2001—2011年,就读于武汉大学世界历史专业,主攻德国近现代史,其中,2009—20年获国家留学基金委赴德国斯图加特大学...
李偉國,出版人,歷史和古文獻學者。歷任上海古籍出版社副社長兼副總編輯,上海辭書出版社社長兼總編輯,上海人民出版社總編輯。曾兩次隨團、三次帶隊前往蘇聯(俄羅斯)和...
王小波,是浪漫騎士、行吟詩人、自由思想家。被台灣著名小說家張大春譽為「恐怕是中國近、現代小說史上第一人。」其作品深具義大利小說家卡爾維諾、捷克小說家米蘭‧昆德拉...
作品目录序言与阿尔瓦·阿尔托的会面阿尔瓦·阿尔托芬兰剧院,图尔库展览:“图尔库700年”《图尔库新闻报》编辑部展览:“最小
不管学习哪种乐器,乐理知识必不可少!无需音乐基础,从零开始,轻松走进音乐世界!..................※编辑推荐※☆ 美国高校经典教材,畅销50余年...
萨瓦里,出生于意大利。20世纪30年代毕业于罗马大学,获土木工程和数学博士学位。二战前后移居美国,曾参与研制原子背景的“曼哈顿”计划。后长期任教于哥伦比亚大学,...
《素锦的香港往事》一书以素锦和妹妹素美(为信主及家人讳,对信中涉及的主要人物姓名作了处理)之间的真实通信为基础,讲述了素锦在香港二十年的日常生活以及期间所历经的...
作品目录布宜诺斯艾利斯激情(1923) 面前的月亮(1925) 圣马丁札记(1929) 诗人(1960) 另一个,同一个(1964) 为六弦琴而
作品目录在路上负责任的旅行亮点目的地:贵州旅行准备旅行线路历史文化苗绣衣装环境饮食贵阳贵阳市区历史方位实用信息危险和麻烦
基斯·M·依迪斯专著的《新解决方案销售(第2 版)》:涵盖了以下重要内容: 强化销售流程:本书强调了可复制的整合销售流 程的价值所在。*值得一提的是,本书将销售...