n341 de IntroCS Algorithm

Embed Size (px)

Citation preview

  • 8/3/2019 n341 de IntroCS Algorithm

    1/14

    CopyrightCopyright 20052005 Department of Computer & Information ScienceDepartment of Computer & Information Science

    Introducing Computer Science:Introducing Computer Science:

    The Study of AlgorithmsThe Study of Algorithms

  • 8/3/2019 n341 de IntroCS Algorithm

    2/14

    CopyrightCopyright 20052005

    Department of Computer & Information ScienceDepartment of Computer & Information Science

    GoalsGoals

    By the end of this lecture you should By the end of this lecture you should

    Understand the role of a computer asUnderstand the role of a computer as

    a tool in Computer Science.a tool in Computer Science. Understand Computer Science as theUnderstand Computer Science as the

    study of algorithms.study of algorithms.

    Be able to identify how algorithms areBe able to identify how algorithms aredeveloped & evaluated.developed & evaluated.

  • 8/3/2019 n341 de IntroCS Algorithm

    3/14

    CopyrightCopyright 20052005

    Department of Computer & Information ScienceDepartment of Computer & Information Science

    The Computer as a ToolThe Computer as a Tool

    Much like the microscope does notMuch like the microscope does notdefine biology or the test tube doesdefine biology or the test tube does

    not define chemistry, the computernot define chemistry, the computerdoesn't define Computer Science.doesn't define Computer Science.

    The computer is a tool by whichThe computer is a tool by which

    Computer Scientists accomplish theirComputer Scientists accomplish theirgoalsgoals to solve problems.to solve problems.

  • 8/3/2019 n341 de IntroCS Algorithm

    4/14

    CopyrightCopyright 20052005

    Department of Computer & Information ScienceDepartment of Computer & Information Science

    What is Computer Science?What is Computer Science?

    NOT about coding or hardware orNOT about coding or hardware orsoftware!software!

    Computer Science is about PROBLEMComputer Science is about PROBLEMSOLVINGSOLVING

    Computer Science is aboutComputer Science is about

    DEVELOPING ALGORITHMSDEVELOPING ALGORITHMS totosolve complex problemssolve complex problems

  • 8/3/2019 n341 de IntroCS Algorithm

    5/14

    CopyrightCopyright 20052005

    Department of Computer & Information ScienceDepartment of Computer & Information Science

    What is an Algorithm?What is an Algorithm?

    An algorithm is a wellAn algorithm is a well--developed,developed,organized approach to solving aorganized approach to solving a

    complex problem.complex problem. Computer Scientists ask themselvesComputer Scientists ask themselves

    four critical questionsfour critical questions when theywhen they

    evaluate algorithms evaluate algorithms

  • 8/3/2019 n341 de IntroCS Algorithm

    6/14

    CopyrightCopyright 20052005

    Department of Computer & Information ScienceDepartment of Computer & Information Science

    Algorithm QuestionsAlgorithm Questions

    Does the algorithm solve the statedDoes the algorithm solve the statedproblem?problem?

    Is the algorithm wellIs the algorithm well--defined?defined? Does the algorithm produce anDoes the algorithm produce an

    output?output?

    Does the algorithm end in aDoes the algorithm end in areasonable length of time?reasonable length of time?

  • 8/3/2019 n341 de IntroCS Algorithm

    7/14

    CopyrightCopyright 20052005

    Department of Computer & Information ScienceDepartment of Computer & Information Science

    Developing an AlgorithmDeveloping an Algorithm

    1.1. Identify the InputsIdentify the Inputs

    2.2. Identify the ProcessesIdentify the Processes

    3.3. Identify the OutputsIdentify the Outputs

    4.4. Develop a HIPO ChartDevelop a HIPO Chart

    5.5. Identify modulesIdentify modules

  • 8/3/2019 n341 de IntroCS Algorithm

    8/14

    CopyrightCopyright 20052005

    Department of Computer & Information ScienceDepartment of Computer & Information Science

    1. Identify the Inputs1. Identify the Inputs

    What data do I need?What data do I need?

    How will I get the data?How will I get the data?

    In what format will the data be?In what format will the data be?

  • 8/3/2019 n341 de IntroCS Algorithm

    9/14

    CopyrightCopyright 20052005

    Department of Computer & Information ScienceDepartment of Computer & Information Science

    2. Identify the Processes2. Identify the Processes

    How can I manipulate data toHow can I manipulate data toproduce meaningful results?produce meaningful results?

    Data vs. InformationData vs. Information

  • 8/3/2019 n341 de IntroCS Algorithm

    10/14

    CopyrightCopyright 20052005

    Department of Computer & Information ScienceDepartment of Computer & Information Science

    3. Identify the Outputs3. Identify the Outputs

    What outputs do I need to return toWhat outputs do I need to return tothe user?the user?

    What format should the outputs take?What format should the outputs take?

  • 8/3/2019 n341 de IntroCS Algorithm

    11/14

    CopyrightCopyright 20052005

    Department of Computer & Information ScienceDepartment of Computer & Information Science

    4. Develop a HIPO Chart4. Develop a HIPO Chart

    PROBLEMPROBLEM

    INPUTINPUT PROCESSESPROCESSES OUTPUTOUTPUT

    MODULEMODULE MODULEMODULE MODULEMODULE MODULEMODULE MODULEMODULE MODULEMODULE

    HHierarchy ofierarchy of IInputsnputs PProcesses &rocesses & OOutputsutputs

  • 8/3/2019 n341 de IntroCS Algorithm

    12/14

    CopyrightCopyright 20052005

    Department of Computer & Information ScienceDepartment of Computer & Information Science

    5. Identify Relevant Modules5. Identify Relevant Modules

    How can I break larger problems intoHow can I break larger problems intosmaller, more manageable pieces?smaller, more manageable pieces?

    What inputs do the modules need?What inputs do the modules need? What processes need to happen inWhat processes need to happen in

    the modules?the modules?

    What outputs are produced by theWhat outputs are produced by themodules?modules?

  • 8/3/2019 n341 de IntroCS Algorithm

    13/14

    CopyrightCopyright 20052005

    Department of Computer & Information ScienceDepartment of Computer & Information Science

    SummarySummary

    The goal of Computer Science is toThe goal of Computer Science is todevelop sound algorithms for solvingdevelop sound algorithms for solving

    complex problems.complex problems. An algorithm is a wellAn algorithm is a well--developed,developed,

    detailed approach for solving adetailed approach for solving a

    problem.problem.

  • 8/3/2019 n341 de IntroCS Algorithm

    14/14

    CopyrightCopyright 20052005

    Department of Computer & Information ScienceDepartment of Computer & Information Science

    SummarySummary

    To develop an algorithm:To develop an algorithm:

    1.1. Identify the inputsIdentify the inputs

    2.2. Identify the processesIdentify the processes

    3.3. Identify the outputsIdentify the outputs

    4.4. Develop a HIPO chartDevelop a HIPO chart5.5. Identify relevant modulesIdentify relevant modules