Photo AI

Last Updated Sep 27, 2025

General Algorithms Simplified Revision Notes

Revision notes with simplified explanations to understand General Algorithms quickly and effectively.

user avatar
user avatar
user avatar
user avatar
user avatar

227+ students studying

10.1.1 General Algorithms

What Are Algorithms?

An algorithm is a step-by-step set of instructions designed to solve a problem or perform a task. Algorithms can be implemented using flowcharts, pseudocode, or computer programs and are fundamental to solving mathematical, computational, and network problems.

Components of an Algorithm

  1. Input: Data provided to the algorithm to process.
  2. Process: The steps or rules that transform the input.
  3. Output: The result or solution derived from the process.

Representing Algorithms

Flowcharts

Flowcharts visually represent the steps in an algorithm. Common flowchart symbols include:

  • Oval (Start/End): Indicates the beginning or end of a process.
  • Rectangle (Process): Represents a task or operation.
  • Diamond (Decision): Represents a decision point with multiple outcomes.
  • Arrows: Indicate the flow of steps.

Pseudocode

Pseudocode describes algorithms in a structured, human-readable format that mimics programming logic. It is not tied to any specific programming language.

Efficiency of Algorithms

The order of an algorithm measures its efficiency, typically in terms of time or computational resources required as the size of the input nn grows.

Big-O Notation

Big-O notation describes the upper bound of an algorithm's complexity:

  • O(1)O(1): Constant time (independent of input size).
  • O(n)O(n): Linear time (directly proportional to input size).
  • O(n2)O(n^2): Quadratic time (e.g., nested loops).
  • O(logn)O(\log n): Logarithmic time (e.g., binary search).

Worked Examples

infoNote

Example 1: Flowchart Algorithm

Design a flowchart to determine whether a number is even or odd.


Steps:

  1. Start.
  2. Input nn
  3. Check nmod2=0n \mod 2 = 0
  • If true, output "Even."
  • If false, output "Odd."
  1. End.

Pseudocode**:**

BEGIN
  Input n
  IF n MOD 2 = 0 THEN
    Output "Even"
  ELSE
    Output "Odd"
  ENDIF
END
infoNote

Example 2: Determine the Order of an Algorithm


Problem:

Given an algorithm that multiplies two n×nn \times n matrices using three nested loops:

for i=1 to n: for j=1 to n: for k=1 to n: result[i][j]+=A[i][k]×B[k][j]\text{for } i = 1 \text{ to } n: \text{ for } j = 1 \text{ to } n: \text{ for } k = 1 \text{ to } n: \text{ result}[i][j] += A[i][k] \times B[k][j]

Solution:

  1. Each loop runs n n times.
  2. The total number of operations is proportional to n×n×n=n3n \times n \times n = n^3
  3. Order: The algorithm is O(n3)O(n^3)
infoNote

Example 3: Shortest Path Algorithm

Find the shortest path between two nodes in a graph using Dijkstra's algorithm.


Order of the Algorithm:

Using a priority queue for efficient selection of the smallest distance:

  • Priority queue operations take O(logn) O(\log n)
  • Processing all edges takes O(Elogn)O(E \log n), where EE is the number of edges.
  • Thus, the algorithm's order is O(Elogn)O(E \log n)

Note Summary

infoNote

Common Mistakes

  1. Misinterpreting flowcharts: Be careful with decision points; clearly follow branches.
  2. Forgetting base cases: Recursive algorithms often fail without proper termination conditions.
  3. Overlooking efficiency: Always analyse the time complexity of nested loops or iterative steps.
  4. Incorrect initialisation: Ensure variables (e.g., distances in shortest path problems) are initialised correctly.
  5. Confusing pseudocode with implementation: Pseudocode is for planning, not direct coding.
infoNote

Key Formulas

  1. Big-O Notation:
  • O(1)O(1): Constant time.
  • O(n)O(n): Linear time.
  • O(n2)O(n^2): Quadratic time.
  • O(logn)O(\log n): Logarithmic time.
  1. Matrix Multiplication Complexity: O(n3)O(n^3) for standard nested-loop algorithms.

  2. Graph Search Algorithms:

  • Dijkstra's Algorithm: O(Elogn)O(E \log n)
  • Floyd-Warshall Algorithm: O(n3)O(n^3)
Books

Only available for registered users.

Sign up now to view the full note, or log in if you already have an account!

500K+ Students Use These Powerful Tools to Master General Algorithms

Enhance your understanding with flashcards, quizzes, and exams—designed to help you grasp key concepts, reinforce learning, and master any topic with confidence!

30 flashcards

Flashcards on General Algorithms

Revise key concepts with interactive flashcards.

Try Further Maths Decision Maths 1 Flashcards

3 quizzes

Quizzes on General Algorithms

Test your knowledge with fun and engaging quizzes.

Try Further Maths Decision Maths 1 Quizzes

29 questions

Exam questions on General Algorithms

Boost your confidence with real exam questions.

Try Further Maths Decision Maths 1 Questions

27 exams created

Exam Builder on General Algorithms

Create custom exams across topics for better practice!

Try Further Maths Decision Maths 1 exam builder

50 papers

Past Papers on General Algorithms

Practice past papers to reinforce exam experience.

Try Further Maths Decision Maths 1 Past Papers

Other Revision Notes related to General Algorithms you should explore

Discover More Revision Notes Related to General Algorithms to Deepen Your Understanding and Improve Your Mastery

96%

114 rated

Algorithms

Sorting Algorithms

user avatar
user avatar
user avatar
user avatar
user avatar

308+ studying

185KViews

96%

114 rated

Algorithms

Bin Packing Algorithms

user avatar
user avatar
user avatar
user avatar
user avatar

395+ studying

191KViews
Load more notes

Join 500,000+ A-Level students using SimpleStudy...

Join Thousands of A-Level Students Using SimpleStudy to Learn Smarter, Stay Organized, and Boost Their Grades with Confidence!

97% of Students

Report Improved Results

98% of Students

Recommend to friends

500,000+

Students Supported

50 Million+

Questions answered