Introduction to Algorithmic Thinking

An algorithm is a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer. In simpler terms, it’s a step-by-step procedure for solving a problem or accomplishing a task.

In computer science,

  1. We can study a problem

  2. We can theorize/design an algorithm that solves the given problem

  3. The created algorithm can be then categorized based on its performance

Algorithm Complexity

Algorithm complexity refers to the amount of computational resources (such as time and space) that an algorithm requires to run. It’s a way to measure and predict how efficiently an algorithm performs, especially as the size of the input data grows.

Example: Linear Search

Linear Search Inputs: a data set and a target value to search

As the dataset of the linear search grows in size, we must compare more values to find the location of the target value within the dataset.

There are two main types of algorithm complexity:

  1. Time Complexity: This measures the amount of time an algorithm takes to complete as a function of the input size. It’s often expressed using Big O notation, which describes the upper bound of the running time.

  2. Space Complexity: This measures the amount of memory an algorithm uses as a function of the input size. Like time complexity, it’s also expressed using Big O notation.

Pre-requisite skills for Algorithmic Thinking

There are two fundamental topics in algorithm design:

  • How to search for a value in a dataset

  • How to sort an unsorted dataset

To prepare for this chapter please the following chapters first:

Last updated