西安电子科技大学:《算法设计技术 Algorithms Design Techniques》课程教学资源(PPT课件讲稿)Techniques Based on Recursion(Chapter 5 Induction Chapter 6 Divide and Conquer Chapter 7 Dynamic Programming)

What's Recursion? Recursion is the process of dividing the problem into one or more subproblems,which are identical in structure to the original problem and then combining the solutions to these subproblems to obtain the solution to the original problem
What’s Recursion? ◼ Recursion is the process of dividing the problem into one or more subproblems, which are identical in structure to the original problem and then combining the solutions to these subproblems to obtain the solution to the original problem

What's Recursion? There are three special cases of the recursion technique: Induction:the idea of induction in mathematical proofs is carried over to the design of efficient algorithms 。 Nonoverlapping subproblems:divide and conquer Overlapping subproblems:dynamic programming,trading space for time
What’s Recursion? ◼ There are three special cases of the recursion technique: ⚫ Induction: the idea of induction in mathematical proofs is carried over to the design of efficient algorithms ⚫ Nonoverlapping subproblems: divide and conquer ⚫ Overlapping subproblems: dynamic programming, trading space for time

Induction Given a problem with parameter n,designing an algorithm by induction is based on the fact that if we know how to solve the problem when presented with a parameter less than n,called the induction hypothesis, then our task reduces to extending that solution to include those instances with parameter n
Induction Given a problem with parameter n, designing an algorithm by induction is based on the fact that if we know how to solve the problem when presented with a parameter less than n, called the induction hypothesis, then our task reduces to extending that solution to include those instances with parameter n

Radix Sort Let L=ta,a,...an be a list of n numbers each consisting of exactly k digits.That is,each number is of the form dd1...d,where each d,is a digit between 0 and 9. In this problem,instead of applying induction onn, the number of objects,we use induction on k,the size of each integer
Radix Sort ◼ Let L={a1 , a2 , …, an} be a list of n numbers each consisting of exactly k digits. That is, each number is of the form dkdk-1…d1 , where each di is a digit between 0 and 9. ◼ In this problem, instead of applying induction on n, the number of objects, we use induction on k, the size of each integer

Radix Sort ■ If the numbers are first distributed into the lists by their least significant digit,then a very efficient algorithm results. Suppose that the numbers are sorted lexicographically according to their least k-1 digits, i.e.,digits de de2r....a. After sorting them on their kth digits,they will eventually be sorted
Radix Sort ◼ If the numbers are first distributed into the lists by their least significant digit, then a very efficient algorithm results. ◼ Suppose that the numbers are sorted lexicographically according to their least k-1 digits, i.e., digits dk-1 , dk-2 , …, d1 . ◼ After sorting them on their kth digits, they will eventually be sorted

Radix Sort First,distribute the numbers into 10 lists Lo,Li,..., Le according to digit d so that those numbers with d=0 constitute list Lo,those with d=1 constitute list L and so on. Next,the lists are coalesced in the order Lo,L1,..., 9 Then,they are distributed into 10 lists according to digit d,coalesced in order,and so on. After distributing them according to d and collecting them in order,all numbers will be sorted
Radix Sort ◼ First, distribute the numbers into 10 lists L0 , L1 , …, L9 according to digit d1 so that those numbers with d1=0 constitute list L0 , those with d1=1 constitute list L1 and so on. ◼ Next, the lists are coalesced in the order L0 , L1 , …, L9 . ◼ Then, they are distributed into 10 lists according to digit d2 , coalesced in order, and so on. ◼ After distributing them according to dk and collecting them in order, all numbers will be sorted

Radix Sort Example:Sort A nondecreasingly. A1..5]=7467327567929134 1239
Radix Sort Example: Sort A nondecreasingly. A[1…5]=7467 3275 6792 9134 1239

Radix Sort Input:A linked list of numbers L=ta,az,...,a and k,the number of digits. Output:L sorted in nondecreasing order. 1.for 1 to 2. Prepare 10 empty lists Lo,Li,...,L9; 3. while L is not empty 4. anext element in L; 5. Delete a from L; 6. kth digit in a 7. Append a to list Li 8. end while; 9. L←L0; 10. fori←-1to9 11. LL,L;//Append list L;to L 12. end for; 13.end for; 14.return L;
Radix Sort ◼ Input: A linked list of numbers L={a1 , a2 , …, an} and k, the number of digits. ◼ Output: L sorted in nondecreasing order. 1. for j1 to k 2. Prepare 10 empty lists L0 , L1 , …, L9; 3. while L is not empty 4. anext element in L; 5. Delete a from L; 6. ijth digit in a; 7. Append a to list Li ; 8. end while; 9. L L0; 10. for i 1 to 9 11. LL, Li //Append list Li to L 12. end for; 13. end for; 14. return L;

Radix Sort What's the performance of the algorithm Radix Sort? √Time Complexity? √Space Complexity?
Radix Sort ◼ What’s the performance of the algorithm Radix Sort? ✓ Time Complexity? ✓ Space Complexity?

Radix Sort Time Complexity:(n) Space Complexity:(n)
Radix Sort ◼ Time Complexity: (n) ◼ Space Complexity: (n)
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 西安电子科技大学:《算法设计技术 Algorithms Design Techniques》课程教学资源(PPT课件讲稿)Chapter 01 Basic Concepts in Algorithmic Analysis(主讲:刘静).ppt
- 《计算机基础》课程教学资源(参考论文)Motif Difficulty(MD):A Predictive Measure of Problem Difficulty for Evolutionary Algorithms using Network Motifs.pdf
- 《计算机基础》课程教学资源(参考论文)An Organizational Evolutionary Algorithm for Numerical Optimization.pdf
- 《计算机基础》课程教学资源(参考论文)A Multiagent Evolutionary Algorithm for Constraint Satisfaction Problems.pdf
- 《计算机基础》课程教学资源(参考论文)Comments on “the 1993 DIMACS Graph Coloring Challenge” and “Energy Function-Based Approaches to Graph Coloring”.pdf
- 《计算机基础》课程教学资源(参考论文)Moving Block Sequence and Organizational Evolutionary Algorithm for General Floorplanning with Arbitrarily Shaped Rectilinear Blocks.pdf
- 《计算机基础》课程教学资源(参考论文)A Multi-Agent Genetic Algorithm for Global Numerical Optimization.pdf
- 《计算机基础》课程教学资源(参考论文)An Organizational Coevolutionary Algorithm for Classification.pdf
- 西安电子科技大学:《大学计算机基础 Fundamentals of Computers》课程教学资源(PPT课件讲稿)Chapter 12,14,15 Lecture_Computer Software(2/2).ppt
- 西安电子科技大学:《大学计算机基础 Fundamentals of Computers》课程教学资源(PPT课件讲稿)Chapter 10-11 Lecture_Computer Software(1/2).ppt
- 西安电子科技大学:《大学计算机基础 Fundamentals of Computers》课程教学资源(PPT课件讲稿)Chapter 1-5 Lecture_Computer Hardware(主讲:刘静).ppt
- 西安电子科技大学:《大学计算机基础 Fundamentals of Computers》课程教学资源(PPT课件讲稿)Chapter 6-8 Lecture_Computer Codes.ppt
- 中国科学技术大学:《计算机网络 Computer Networks(计算机通信网)》课程教学资源(PPT课件讲稿,2022)Chapter 04 局域网与介质访问控制(卢汉成).pptx
- 中国科学技术大学:《计算机网络 Computer Networks(计算机通信网)》课程教学资源(PPT课件讲稿,2022)Chapter 03 数据链路层(卢汉成).pptx
- 中国科学技术大学:《计算机网络 Computer Networks(计算机通信网)》课程教学资源(PPT课件讲稿,2022)Chapter 02 物理层(卢汉成).pptx
- 中国科学技术大学:《计算机网络 Computer Networks(计算机通信网)》课程教学资源(PPT课件讲稿,2022)Chapter 01 简介、概述(卢汉成).pptx
- 中国科学技术大学:《计算机网络 Computer Networks(计算机通信网)》课程教学资源(PPT课件讲稿,2022)Chapter 05 LAN & MAC Sub layer(洪佩琳).pptx
- 中国科学技术大学:《计算机网络 Computer Networks(计算机通信网)》课程教学资源(PPT课件讲稿,2022)Chapter 04 数据链路层(洪佩琳).pptx
- 中国科学技术大学:《计算机网络 Computer Networks(计算机通信网)》课程教学资源(PPT课件讲稿,2022)Chapter 03 物理层(洪佩琳).pptx
- 中国科学技术大学:《计算机网络 Computer Networks(计算机通信网)》课程教学资源(PPT课件讲稿,2022)Chapter 02 网络的体系结构与参考模型(洪佩琳).pptx
- 西安电子科技大学:《算法设计技术 Algorithms Design Techniques》课程教学资源(PPT课件讲稿)First-Cut Techniques(Chapter 8 The Greedy Approach Chapter 9 Graph Traversal).ppt
- 西安电子科技大学:《算法设计技术 Algorithms Design Techniques》课程教学资源(PPT课件讲稿)Coping with Hardness(Chapter 13 Backtracking Chapter 14 Randomized Algorithms Chapter 15 Approximation Algorithms).ppt
- 西安电子科技大学:《算法设计技术 Algorithms Design Techniques》课程教学资源(PPT课件讲稿)Iterative Improvement for Domain-Specific Problems(Chapter 16 Network Flow Chapter 17 Matching).ppt
- 西安电子科技大学:《数据结构与算法分析 Data Structure and Algorithm Analysis》课程教学资源(PPT课件讲稿)06 Algorithm Analysis and Sorting.ppt
- 西安电子科技大学:《数据结构与算法分析 Data Structure and Algorithm Analysis》课程教学资源(PPT课件讲稿)07 Graph Algorithms.ppt
- 西安电子科技大学:《数据结构与算法分析 Data Structure and Algorithm Analysis》课程教学资源(PPT课件讲稿)08 Algorithm Design Techniques.ppt
- 西安电子科技大学:《数据结构与算法分析 Data Structure and Algorithm Analysis》课程教学资源(PPT课件讲稿)03 Hashing.ppt
- 西安电子科技大学:《数据结构与算法分析 Data Structure and Algorithm Analysis》课程教学资源(PPT课件讲稿)04 Priority Queues(Heaps).ppt
- 西安电子科技大学:《数据结构与算法分析 Data Structure and Algorithm Analysis》课程教学资源(PPT课件讲稿)05 Disjoint Set ADT.ppt
- 西安电子科技大学:《数据结构与算法分析 Data Structure and Algorithm Analysis》课程教学资源(PPT课件讲稿)02 Trees(主讲:刘静).ppt
- 西安电子科技大学:《数据结构与算法分析 Data Structure and Algorithm Analysis》课程教学资源(PPT课件讲稿)01 Lists, Stacks, and Queues.ppt
- 中国科学技术大学:Robust Speech Recognition with Speech Enhanced Deep Neural Networks.pdf
- 南京大学:《编译原理 Principles and Techniques of Compilers》课程教学电子教案(课件讲义)第九章 机器无关的优化.pdf
- 南京大学:《编译原理 Principles and Techniques of Compilers》课程教学电子教案(课件讲义)第八章 代码生成.pdf
- 南京大学:《编译原理 Principles and Techniques of Compilers》课程教学电子教案(课件讲义)第七章 运行时刻环境.pdf
- 南京大学:《编译原理 Principles and Techniques of Compilers》课程教学电子教案(课件讲义)第六章 中间代码生成.pdf
- 南京大学:《编译原理 Principles and Techniques of Compilers》课程教学电子教案(课件讲义)第五章 语法制导的翻译.pdf
- 南京大学:《编译原理 Principles and Techniques of Compilers》课程教学电子教案(课件讲义)第四章 语法分析.pdf
- 南京大学:《编译原理 Principles and Techniques of Compilers》课程教学电子教案(课件讲义)第三章 词法分析.pdf
- 南京大学:《编译原理 Principles and Techniques of Compilers》课程教学电子教案(课件讲义)第一章 引论(许畅).pdf