Screen Shot 2017-02-22 at 23.20.45

AS Algorithms Python Examples


This is a full set of example algorithms written in Python, designed to teach AS level students about various sorting and searching algorithms. If you want to view a free example of what you can expect to find in this resource, take a loot at our example merge sort code here.

Categories: , ,

Product Description

Compatibility: Although written in Python 2.7, these Python files should be fully compatible with Python 3.

This is a complete set of Python examples for the current A-Level Algorithms specification, excluding examples for path finding algorithms which may be added at a later stage. Below is a list of the included algorithms and their corresponding orders (Big O):

  • Sequential/Linear Search – O(n)
  • Binary Search – O(logn)
  • Hash Tables – O(1) depending on collision response strategy
  • Insertion Sort – O(n^2) worst case
  • Bubble Sort – O(n^2) worst case
  • Merge Sort – O(nlogn) best case
  • Quick Sort – O(nlogn) best case

For each of the algorithms there is at least one of the below code examples:

  • Base Algorithm – This file is a basic implementation of the algorithm, showing students how the technique works. The code contains no comments and is designed to allow students opportunity to work out what the algorithm is doing.
  • Base Algorithm with comments – This file extends on the basic algorithm program by adding detailed comments on what is happening.
  • Base Algorithm with output – This file extends the algorithm by including detailed output in the console to show what is happening at each individual stage of the algorithm.
  • Base Algorithm with comparisons – This file counts the number of comparisons that are made whilst the algorithm is running to allow students to estimate the order (Big O) of the algorithm
  • Base Algorithm incomplete – This is a skeleton code file that has sections of the code missing, allowing students to try and devise their own logical solution to the merge sort problem.

As with any resource, this list is neither exhaustive nor complete and as time progresses the files contained within this example code repository will be updated and extended, available to re-download free of charge.


There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.