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 University, Canada. He has taught their algorithms course thirteen times to date. He has worked extensively at IIT Mumbai, India, and University of California San Diego. He is well published in the top theoretical computer science journals in topics including complexity theory, scheduling, proof systems, probability theory, combinatorics, and, of course, algorithms.
个人感觉:Part I五星,Part II四星,后边没太认真读,没有前几章那么有意思…… 看第一部分的时候觉得很对胃口,因为很少有书这么描述循环不变量的,虽然配了好多完全主题无关的诡异图片。 到了第二部分也还行,尤其是看到With a Little Help From Your Friends觉得作者还挺有...
評分个人感觉:Part I五星,Part II四星,后边没太认真读,没有前几章那么有意思…… 看第一部分的时候觉得很对胃口,因为很少有书这么描述循环不变量的,虽然配了好多完全主题无关的诡异图片。 到了第二部分也还行,尤其是看到With a Little Help From Your Friends觉得作者还挺有...
評分个人感觉:Part I五星,Part II四星,后边没太认真读,没有前几章那么有意思…… 看第一部分的时候觉得很对胃口,因为很少有书这么描述循环不变量的,虽然配了好多完全主题无关的诡异图片。 到了第二部分也还行,尤其是看到With a Little Help From Your Friends觉得作者还挺有...
評分个人感觉:Part I五星,Part II四星,后边没太认真读,没有前几章那么有意思…… 看第一部分的时候觉得很对胃口,因为很少有书这么描述循环不变量的,虽然配了好多完全主题无关的诡异图片。 到了第二部分也还行,尤其是看到With a Little Help From Your Friends觉得作者还挺有...
評分个人感觉:Part I五星,Part II四星,后边没太认真读,没有前几章那么有意思…… 看第一部分的时候觉得很对胃口,因为很少有书这么描述循环不变量的,虽然配了好多完全主题无关的诡异图片。 到了第二部分也还行,尤其是看到With a Little Help From Your Friends觉得作者还挺有...
我之前對算法的理解一直停留在“背誦”的層麵,就是記住各種排序算法、查找算法的名字和它們的基本邏輯,但總感覺知其然不知其所以然。這本《How to Think About Algorithms》則徹底顛覆瞭我的認知。《How to Think About Algorithms》的魅力在於它將算法的“思想”和“方法”與具體的“實現”區分開來,並且將前者置於更重要的位置。它就像一個哲學老師,教你如何用哲學傢的視角去審視算法,而不是僅僅教你如何成為一個算術的機器。書中的案例分析非常到位,它不僅僅是列齣算法,還會深入剖析為什麼這個算法會有效,它在解決什麼樣的問題時錶現最佳,又會在什麼情況下顯得力不從心。這種“反思性”的學習過程,讓我對算法的理解更加深刻,也更加靈活。我不再害怕遇到沒見過的算法問題,因為我知道,即使我不知道具體的算法,我也能通過書中教授的思維框架,去分析問題,去設計一個屬於自己的解決方案。這本書的語言風格也十分友好,沒有太多晦澀難懂的術語,更注重用清晰的邏輯和生動的比喻來闡述復雜的概念。讀起來一點都不枯燥,反而充滿樂趣,讓我對算法的學習充滿瞭好奇心和動力。
评分一直以來,我對算法的概念都停留在“編程實現”的層麵,感覺隻要把代碼敲齣來,算法就完成瞭。然而,《How to Think About Algorithms》這本書完全改變瞭我的這種刻闆印象。它將算法的思考過程擺在瞭首要位置,強調的是“如何理解問題,如何設計解決方案”這個核心。我尤其喜歡作者在書中對“貪心算法”和“動態規劃”的講解,他用非常生動的例子,比如“找零錢問題”或者“背包問題”,來解釋這些復雜算法的直觀思路,讓我不再覺得它們遙不可及。這本書不是那種填鴨式的教學,而是像一位睿智的嚮導,引領我一步步探索算法的奧秘。它教會我如何去分析問題的結構,如何去識彆其中的重復模式,如何去設計最優的策略。我感覺自己不僅僅是在學習算法,更是在學習一種解決問題的“元認知”能力。讀完之後,我發現自己看待很多問題都多瞭一層算法的視角,更加注重效率和優化。這本書的語言也非常流暢易懂,即使是沒有深厚數學背景的讀者,也能輕鬆理解。它真正做到瞭“授人以魚不如授人以漁”,讓我掌握瞭思考算法的“道”,而不僅僅是學習幾個算法的“術”。
评分《How to Think About Algorithms》這本書給我的感覺是,它不是在“教”你算法,而是在“激發”你思考算法。它更像是一種思維訓練的工具,而不是一本死記硬背的教科書。我印象最深的是,書中關於“復雜度分析”的部分,它沒有直接給齣大O符號的各種形式,而是通過非常形象的類比,比如“一個人獨自一人完成任務”和“一群人協同完成任務”來闡述時間復雜度的概念,讓我一下子就明白瞭為什麼有的算法快,有的算法慢。作者的寫作風格非常獨特,他不是那種一本正經的學術腔調,而是充滿瞭啓發性和趣味性,讓人讀起來感覺很輕鬆,但又時時刻刻在挑戰你的思維極限。每一次閱讀,我都能從中獲得新的感悟,發現新的思路。這本書讓我明白,學習算法最重要的一環,是理解其背後的邏輯和思想,而不是死記硬背代碼。當我遇到一個新問題時,我不再是第一時間去搜索“有沒有現成的算法”,而是會先嘗試運用書中教授的思維方式去分析它,去構建自己的解決方案。這種“自己動手,豐衣足食”的學習過程,讓我對算法的掌握更加牢固,也更加自信。
评分這絕對是一本令人耳目一新、受益匪淺的圖書!我一直對算法領域感到有些畏懼,總覺得那是數學傢和計算機科學傢的專屬領域,充滿瞭高深的理論和復雜的公式。然而,《How to Think About Algorithms》徹底打消瞭我的顧慮。這本書的作者並沒有上來就拋齣一堆算法代碼或者數學證明,而是從一個非常宏觀的角度,將算法的本質——解決問題的策略——展現在我們麵前。它像一位循循善誘的老師,帶領我們一步一步地剝離問題的外殼,探究其內在的邏輯結構,然後思考如何用最有效的方式來處理。我尤其喜歡書中對各種“問題分解”和“遞歸思想”的講解,這些概念以前聽起來像是天書,現在在作者的引導下,我感覺自己都能觸摸到它們的脈絡。書中的例子非常貼近生活,比如如何規劃一次旅行,如何安排日程,這些看似簡單的生活場景,卻被作者巧妙地轉化成瞭算法思考的絕佳載體。這讓我意識到,算法並非遙不可及,它就隱藏在我們生活的每一個角落,而掌握瞭算法思維,就是掌握瞭一種強大的解決問題的工具。讀完這本書,我感覺自己的思維變得更加清晰、有條理,處理復雜問題時也更加得心應手。
评分這本書真的讓我腦洞大開!我一直以為算法就是那些在電腦屏幕上閃爍的代碼,或者是一些復雜的數學公式,但在讀瞭《How to Think About Algorithms》之後,我纔意識到算法原來是一種看待和解決問題的方式,一種思維的藝術。它不僅僅是關於“怎麼做”,更重要的是“為什麼這麼做”。作者巧妙地運用瞭很多我日常生活中就能找到的例子,比如排隊買咖啡、打包行李,甚至是整理房間,把抽象的算法概念具象化,讓我瞬間就有瞭“哦,原來是這樣!”的頓悟感。最讓我驚喜的是,這本書並沒有直接給我一堆算法的定義和實現,而是引導我一步一步地去思考,去探索。當我遇到一個問題時,這本書會鼓勵我去分析問題的本質,去思考有哪些可能的解決方案,以及每種方案的優缺點。這種循序漸進的學習方式,讓我感覺自己不是在被動地接受知識,而是在主動地參與到算法的創造過程中。讀完這本書,我感覺自己看待問題的方式都變得不一樣瞭,仿佛擁有瞭一雙能發現隱藏在生活中的算法的“慧眼”。即使是一些我以前覺得很棘手的技術難題,現在也多瞭幾分嘗試的勇氣和解決的思路。這絕對是一本能改變你思考方式的書,強烈推薦給所有對算法感興趣,或者希望提升解決問題能力的朋友們。
评分搜Loop Invariant的時候搜到這本書然後讀入迷瞭居然,思路很特彆。已經過瞭一遍CLRS後再看效果更佳
评分搜Loop Invariant的時候搜到這本書然後讀入迷瞭居然,思路很特彆。已經過瞭一遍CLRS後再看效果更佳
评分搜Loop Invariant的時候搜到這本書然後讀入迷瞭居然,思路很特彆。已經過瞭一遍CLRS後再看效果更佳
评分搜Loop Invariant的時候搜到這本書然後讀入迷瞭居然,思路很特彆。已經過瞭一遍CLRS後再看效果更佳
评分搜Loop Invariant的時候搜到這本書然後讀入迷瞭居然,思路很特彆。已經過瞭一遍CLRS後再看效果更佳
本站所有內容均為互聯網搜索引擎提供的公開搜索信息,本站不存儲任何數據與內容,任何內容與數據均與本站無關,如有需要請聯繫相關搜索引擎包括但不限於百度,google,bing,sogou 等
© 2026 qciss.net All Rights Reserved. 小哈圖書下載中心 版权所有