fundamentals of algorithms

Cards (18)

  • computational thinking
    the thought process involved in formulating a problem and expressing its solution in such a way that a computer can effectively carry out
  • decomposition
    breaking down the problem into smaller sub-problems, so that each sub-problem accomplishes an identifiable task
  • pattern recogntition
    finding repeating patterns that could be solved quickly
  • abstraction
    removing unnecessary detail from a problem
  • algorithm creation
    creating a step by step set of instructions to solve the problem
  • algorithm
    a step-by-step solution to solve a problem ina finite number of steps
  • three parts to an algorithm:
    • input - the values that are put into the algorithm
    • process - what happens in the algorithms
    • output - the value that the algorithm produces
  • flowcharts
    a graphical way of displaying an algorithm
  • flow chart symbols
    A) start/stop
    B) beginning
    C) end
    D) process
    E) assign
    F) do something
    G) decision
    H) calculation
    I) direction
    J) 1
    K) answers
    L) input/output
    M) input
    N) output
    O) connector
    P) connectors
    Q) direction
    R) flow
    S) travel
  • comparing flowcharts to pseudocode
    • pseudocode is much easier to create accurate and detailed algorithms
    • flow charts are an easier way to see the flow of a program and how it runs from start to finish
  • pseudocode
    text that is written programmatically but designed to be read by humans and not a machine
  • variable assignment in pseudocode
    IDENTIFIER <- value
  • user input in pseudocode
    variable <- USERINPUT
  • output(print) in pseudocode
    OUTPUT StringExp
  • random integer in pseudocode
    RANDOM_INT(IntExp, IntExp)
  • commentsin pseudocode
    # comment
  • trace tables
    a way for us to track the value of a variable through a program, they are very useful for helping to identify logic errors
  • we can compare how efficient algorithms are by calculating how much time they take to complete a task and we can do that by working out how many calculations are required for the algorithm to be completed