Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Algorithms (AP)

Scott Kowalczewski edited this page Sep 5, 2019 · 20 revisions

An algorithm is a set of instructions used to solve a problem. You use algorithms every day, for example:

Getting Ready for School

1. Wake Up

2. Eat Breakfast

3. Brush Teeth

4. Get Dressed

etc

Algorithms can be expressed in plain language (like above), flow charts (later!) or pseudocode (code intended to be read by humans and not computers).

There are three main components of algorithms:

Sequencing

This refers to the fact that the steps need to be completed in that order (top to bottom). It wouldn't make sense to Brush Teeth before Wake Up.

Selection

Perhaps something should only happen IF a condition is met. For example:

Getting Ready for School

1. Wake Up

2. I am hungry:

Eat Breakfast

2. Eat Breakfast

Clone this wiki locally