2.1 - Algorithms

Cards (17)

  • 3 Types of Computational Thinking
    • A - Abstraction
    • D - Decomposition
    • AT - Algorithmic Thinking
  • Abstraction:
    • Identifying key parts of the problem and hiding those that are less important
    • Leaving out unnecessary details and only including important details
  • Decomposition:
    • Breaking down one large complex problem into smaller sub-problems so it is easier to solve
    • Done by using a structure diagram
    • Steps: Identify main problem, List main components/functions, Break them down into smaller components
  • Algorithmic Thinking:
    • Consideration of steps that go into solving a problem
    • Algorithm - Series of steps that a program needs to perform or solve a problem
  • The input is what is entered by someone on a keyboard
  • A process is how the data inputted is handled throughout the program (arithmetic, sorting a list)
  • An output is the end result after processing
  • Arrow represents the flow of control passing between stages
  • A parallelogram is used to represent an input or output
  • A rectangle is used to show a process or calculation
  • A diamond/rhombus is used to represent a decision
  • An oval/terminal symbol is used to represent the start/end of a program
  • This is used to represent a subroutine
  • Pros and cons of Pseudocode:
    • (+) Can be easy to understand for many people
    • (+) Doesn't matter if there are syntax errors
    • (+) Changes can easily be incorporated
    • (-) Is hard to see how a program flows
    • (-) It can be time consuming to produce
  • Pros and Cons of flowcharts:
    • (+) Easy to see how a program flows
    • (+) They follow an international standard - any flow diagram user can understand it
    • (-) Large programs can cause them to be hard to follow
    • (-) Any changes means a lot of the diagram has to be redrawn
  • A trace table is used to show how the values of variables change throughout the program
    EXAMPLE:
  • Common types of errors:
    • Syntax error: Occurs when a statement doesn't meet the rules of the language
    • Logic Error: Occurs when the output is not what the user intended it to be