?计算机科学导论?课件Unit 8Algorithms * 8-1 What Is Algorithm? 8-2 Three Constructs 8-3 How to Evaluate Algorithms 8-4 Algorithm Representation 8-5 Basic Algorithms 8-6 Classification of Algorithm 8-7 References and Recommended Reading 8-8 Key terms 8-9 Summary 8-10 Practice Set OUTLINE * Define an algorithm and relate it to problem solving. Define three construct and describe their use in algorithms. Describe UML diagrams and pseudocode and how they areused in algorithms. After reading this chapter, you are supposed tobe able to : OBJECTIVES Understand how to evaluate algorithms. Describe the concept of sorting and understand themechanisms behind seven primitive sorting algorithms. Describe the concept of searching and understand themechanisms behind two common searching algorithms. Understand the implementation of algorithms by differentbasic principles. * Problem solving Definition of Algorithm 8-1 What Is Algorithm? * Problem Solving If your friend can't use E-mail, how will you teach him? Question The general steps for using a mailbox are as following: step 1: open the e-mail ; step 2: click “write letters〞; step 3: enter the recipient e-mail address; step 4: enter the subject line; step 5: enter the text of the message; step 6: click “send〞. * Problem Solving Problem solving【问题求解】 is to find a solution for a complicated, distressing, vexing, or unsettled question. In computer science, we call the plan of solution an algorithm【算法】. Figure An algorithm used in a computer * Definition of Algorithm An algorithm is a series of clear instructions to solve the problem, that is, you can get the required output【要求的输出】 in a limited time for a normative input【标准的输入】. an algorithm used in a computer * Definition of Algorithm Algorithms have five basic characteristics: Input【输入】: An algorithm must have zero or multiple input that inscribes the initial condition of the operands. Output【输出】: