top of page

CEP824 - Unit 2 Algorithms

  • Writer: Shuaiqi Hu
    Shuaiqi Hu
  • Jan 24, 2022
  • 1 min read

Define

An algorithm is a sequence of well-defined, precise steps for solving a problem.



Algorithmic Thinking

Algorithmic thinking refers to our ability solving problems in an effective way leading to an algorithm. Algorithmic thinking also includes the ability to understand that some problems cannot be solved by an algorithm. It involves

  • the ability to specify a problem precisely

  • the ability to create and describe an algorithm to solve the problem

  • the ability to answer “what if” questions about the algorithm

  • the ability to argue the correctness of an algorithm

  • the ability to find examples of inputs on which the algorithm fails to work as expected (if not a correct algorithm)

Practice

Record the EXACT instructions for making a peanut butter and jelly sandwich.This should be in a numbered ordered list and should be as precise as you can possibly make it.


  1. Take 2 pieces of bread from the package;

  2. Put into bread toasters for 2 minutes;

  3. While waiting, take peanut butter and jelly from the fridge;

  4. Put toasted bread onto plate;

  5. Spread the peanut butter on one piece of bread;

  6. Spread the jelly onto the other piece;

  7. Put the two pieces of bread together, two sides with peanut butter/jelly facing together;

  8. Now we have our peanut butter and jelly sandwich




Opmerkingen


bottom of page