{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Module02 - Module 2 Fundamental Concepts Problems Programs...

Info icon This preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Module 2: Fundamental Concepts Problems Programs Programming languages
Image of page 1

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

View Full Document Right Arrow Icon
2 Problems We view solving problems as the main application for computer programs
Image of page 2
3 Inputs Outputs (4,2,3,1) (3,1,2,4) (7,5,1) (1,2,3) (1,2,3,4) (1,5,7) (1,2,3) Definition A problem is a mapping or function between a set of inputs and a set of outputs Example Problem: Sorting
Image of page 3

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

View Full Document Right Arrow Icon
4 How to specify a problem Input Describe what an input instance looks like Output Describe what task should be performed on the input In particular, describe what output should be produced
Image of page 4
5 Example Problem Specifications* Sorting problem Input Integers n 1 , n 2 , ..., n k Output – n 1 , n 2 , ..., n k in nondecreasing order Find element problem Input Integers n 1 , n 2 , …, n k Search key S Output yes if S is in n 1 , n 2 , …, n k , no otherwise
Image of page 5

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

View Full Document Right Arrow Icon
6 Programs Programs solve problems
Image of page 6
7 Purpose Why do we write programs? One answer To solve problems What does it mean to solve a problem?
Image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern