p2 - Chapter 2 The Algorithmic Foundations of Computer Science INVITATION TO Computer Science Tuesday 1 Objectives After studying this chapter students

# p2 - Chapter 2 The Algorithmic Foundations of Computer...

• 35

This preview shows page 1 - 9 out of 35 pages.

INVITATION TO Computer Science 1 Chapter 2 The Algorithmic Foundations of Computer Science Tuesday, September 10, 13
Objectives After studying this chapter, students will be able to: Explain the benefits of pseudocode over natural language or a programming language Represent algorithms using pseudocode Identify algorithm statements as sequential, conditional, or iterative Define abstraction and top-down design, and explain their use in breaking down complex problems Invitation to Computer Science, 6th Edition 2 Tuesday, September 10, 13
Objectives (continued) After studying this chapter, students will be able to: Illustrate the operation of sample algorithms – multiplication by repeated addition – sequential search of a collection of values – finding the maximum element in a collection – finding a pattern string in a larger piece of text Invitation to Computer Science, 6th Edition 3 Tuesday, September 10, 13
Introduction Algorithms for everyday may not be suitable for computers to perform (as in Chapter 1) Algorithmic problem solving focuses on algorithms suitable for computers Pseudocode is a tool for designing algorithms This chapter will use a set of problems to illustrate algorithmic problem solving Invitation to Computer Science, 6th Edition 4 Tuesday, September 10, 13
Representing Algorithms Pseudocode is used to design algorithms Natural language is: – expressive, easy to use – verbose, unstructured, and ambiguous Programming languages are: – structured, designed for computers – grammatically fussy, cryptic Pseudocode lies somewhere between these two Invitation to Computer Science, 6th Edition 5 Tuesday, September 10, 13
Invitation to Computer Science, 6th Edition 6 Tuesday, September 10, 13
Invitation to Computer Science, 6th Edition 7 Tuesday, September 10, 13
Representing Algorithms (continued) Sequential operations perform a single task Computation : a single numeric calculation Input : gets data values from outside the algorithm Output : sends data values to the outside world • A variable is a named location to hold a value