CS1371_02_Problem_Solving

# CS1371_02_Problem_Solving - CS1371 Introduction to...

This preview shows pages 1–7. Sign up to view the full content.

1 CS1371 Introduction to Computing for Engineers Problem Solving and Abstraction

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 Problem Solving and Abstraction Solving Problems Taxonomy of Operations on Collections Working forward from the data Working backward from the answer Designing the Algorithm Implementing the Code Learning Objectives Understanding how to solve problems Understanding the value of modularity
3 Problem Solving in General Problem solving is a fundamentally creative skill This skill is learned by practice – solving problems of different types. Different types of problem require different problem solving skills: Solving Physics problems frequently involves identifying the appropriate principles and formulas based on the given input data Algebra problems require an algebraic representation of the given information followed by manipulating equations and axioms until the answer is derived Geometry problems are similar, but usually involve graphical representations of the situation

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 Problem Solving in Computer Science The end result of a computer science problem is a program that produces the right behavior. As with problem solving in general, there is a wide spectrum of approaches to problem-solving depending on the nature of the problem Numeric computation (solving equations) User interaction (games, graphics) Modeling and simulation (Object-Oriented Programming) [more on this later]
5 Computation Problems This type of problem will present you with some data and ask you to compute some result(s). With simple problems, you may be able to find the solution directly. With more complex problems, you have to work in two directions: Forward from the data, and Backwards from the answer data answer What you could do with the data How you could find the answer Find a possible match Solve the sub-problems

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6 Possible Operations There are only 6 different operations you can possibly perform on a collection of like data items. Each operation requires a function to specify how that operation should be performed Any algorithm can be constructed by applying these operations in some order. The operations are: Build – create the collection from some source Traverse – touch each item and maybe summarize Map – change the values in each item Filter – remove some items from the collection Search – determine whether a specific item exists Sort – re-order the collection
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern