ITP Algorithm - T2

Cards (23)

  • Computer
    A useful tool for solving a great variety of problems
  • Computer program
    You tell a computer, step by step, exactly what you want it to do
  • Algorithm
    The sequence of steps to be performed in order to solve a problem by the computer
  • Program Design
    The steps a programmer should do before they start coding the program in a specific language
  • Algorithm
    • A finite sequence of steps expressed for solving a problem
    • Used for calculation, data processing, and many other fields
  • Good algorithm
    It does the job with the right amount of effort
  • Algorithms
    • Taxi algorithm
    • Call-me algorithm
    • Bus algorithm
  • Algorithms
    • Efficiency
    • Abstraction
    • Reusability
  • Efficiency
    Certain types of problems, like sorting, occur often in computing. Efficient algorithms must be used to solve such problems considering the time and cost factor involved in each algorithm.
  • Abstraction
    Algorithms provide a level of abstraction in solving problems because most complicated problems can be separated into simpler ones.
  • Reusability
    Algorithms are often reusable in many different situations. Many well-known algorithms can be found as part of complicated ones, and many complicated problems can be distilled into simpler ones.
  • Ways to express algorithms
    • Natural languages
    • Pseudo-code
    • Flowcharts
    • Programming languages
  • Programming languages
    Primarily intended for expressing algorithms in a form that can be executed by a computer, but are often used to define or document algorithms
  • Algorithm Analysis
    The theoretical study of computer program performance and resource usage
  • Pseudo-code
    An informal high-level description of the operating principle of a computer program or other algorithm, using the structural conventions of a programming language, but intended for human reading rather than machine reading
  • Pseudo-code example
    • If student's grade is greater than or equal to 50, display "passed", else display "failed"
  • Pseudo-code
    • Easier for people to understand than conventional programming language
    • Efficient and programming language independent
    • Used in textbooks and scientific publications for documenting various algorithms
    • Used for sketching out the structure of the program before the actual coding takes place
  • Flowchart
    A type of diagram (graphical or symbolic) that represents an algorithm or process, where each step is represented by a different symbol and contains a short description of the process step, linked together with arrows showing the process flow direction
  • Flowcharts
    • Communicate how a process works or should work without any technical or group specific jargon
    • Used in analyzing, designing, documenting or managing a process or program in various fields
    • Drawn in the early stages of formulating computer solutions
    • Facilitate communication between programmers and business people
    • Helpful in understanding the logic of complicated and lengthy problems
    • Helpful in explaining the program to others
  • Flowchart
    Can be likened to the blueprint of a building
  • Flowcharts are usually drawn using some standard symbols, however, some special symbols can also be developed when required.
  • Problem solving techniques
    • Always have a plan
    • Restate the problem
    • Divide the problem
    • Start with what you know
    • Reduce the problem
    • Look for analogies
    • Experiment
    • Don't get frustrated
  • A bug happens not because of the computer but because of our instruction. There are many ways to plan how to instruct the computer to do something and it is always wise to come up with a plan before you start to program.