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...
(展开全部)
猪病中西医结合治疗 本书特色 《猪病中西医结合治疗》适合养猪专业户和基层兽医工作者阅读,同时对兽药生产和经销人员也有较强的参考价值。猪病中西医结合治疗 内容简介...
苏国勋 1942年2月生,北京市人,研究员。主要学术专长是社会学思想史,现从事社会学理论研究。1965年9月毕业于北京师范学院外语系,1978年9月~1981年...
Aswemoveintothethirdmillennium,thefieldofmentalhealthisinanexcitingpositiontobri...
作品目录【第一卷】第一章 近东的起源旧石器时代新石器时代美索不达米亚文明美索不达米亚文化的传播埃及,法老的土地(前3100-前
✡编辑推荐✡-✡谎言掩盖的伤痛永远不会愈合,唯有真相才能治愈。✡日本推理小说的传世经典!日本销量超300万册!✡15年精心构思,9年提笔打磨,耗费4700张稿纸...
《你好 中小学人工智能》内容简介:本书是一本体系完整、综合全面介绍中小学人工智能相关内容的书籍。本书涉及人工智能的历史与发展
How do groups of neurons interact to enable the organism to see, decide, and mov...
葛洪(284~364),字稚川,自号抱朴子。东晋道教学者、著名炼丹家、医药学家。三国方士葛玄之侄孙,世称小仙翁。他曾受封为关内侯,后隐居罗浮山炼丹。著有《神仙传...
战国时期,在一座叫清溪鬼谷的山上(今河南省鹤壁市),隐居着一位被尊称为“鬼谷子”的老人(本名王诩),他每天在山上看书、打坐、冥想,过着与世隔绝的生活。但是,两千...
你有看看这个世界的近况吗?有些人在食品中添加致病化学物质,只为货架上能待得更久;有些人过着纸醉金迷的生活,而无数非洲儿童却因饥饿长眠母亲怀中;有些人贪婪的目光流...
瑞贝卡·费特(Rebecca Fett)瑞贝卡·费特拥有悉尼大学分子生物技术和生物化学学士学位。在她26岁准备接受体外受精-胚胎移植治疗时,被诊断出卵巢储备功能...
Designedtohelpreadersgainabetterunderstandingofculturaldynamics,"DiversityinCoun...
中医临床思维教程 内容简介 《浙江省重点教材:中医临床思维教程》列出了临床各科室有代表性的病证。分内科疾病、妇科疾病、儿科疾病、眼科疾病、耳鼻喉科疾病、骨伤科疾...
[美]丹·斯柯伯尔(Dan Schawbel)《纽约时报》“自品牌专家”,知名职业生涯规划专家。所创自品牌博客被《福布斯》杂志列为“职场加油站”。他是《时代》《...
手术解剖学-(第2版) 节选 br /> 很荣幸为这本表述详细而措辞生动的著作作序。在许多医学院校,医学生接受的解剖学课时正在显著减少,常减少到只有30年...
组合导航智能容错与故障检测方法 本书特色 本书主要介绍了组合导航原理、技术与实现方法,结合近些年来智能计算方法的发展,重点讨论了遗传算法、模糊理论、神经网络、支...
認真對待日常生活中的每個小細節,正是保持好心情的不二法門。利用閒暇時間熨燙晾乾的襯衫,早上梳洗後套上筆挺的服裝,大力地伸個懶腰,便可以神采奕奕的面容度過新的一天...
* “红学泰斗”周汝昌,70年书法研究心得总结,写给大家的书法艺术讲义。* “永字八法”是学习书法的基本功,是理解“书”之有“法”的必修课。* 指陈书家得失,纠...
全球销量超过10000000册的《情商》作者“情商之父”丹尼尔·戈尔曼成名巨作。《情商》是20世纪颇具影响力的话题书籍之一。雄踞美国《纽约时报》畅销书排行榜前1...
刘媛,摩羯座,新闻工作者。我以十年一梦筑此台,愿这土地上的英雄气亘古流传,为五千年的历史增添一段故事。