A repo with some code used to compare timing of recursion and iteration
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Analyse_Binary.py
Analyse_factorial.py
Compare_Binary.py
Compare_Factorial.py
README.md
binary_all_data.pdf
binary_all_data.png
binary_mean.pdf
binary_mean.png
factorial.csv
factorial.pdf
factorial.png
iterativebinarysearch.csv
makefile
recursivebinarysearch.csv

README.md

Comparing Recursion and Iterative Algorithms

Repo for a blog post comparing recursive and iterative implementations of binary search and factorial algorithms.

Contents

There are two pairs of python scripts: Compare_[Binary/Factorial].py and Analyse_[Binary/Factorial].py. The first runs a comparison of either a binary search of factorial algorithm outputting some data:

  • iterativebinarysearch.csv
  • recursivebinarysearch.csv
  • factorial.csv

Subsequently the analysis scripts can be used to obtain the plots shown in this blog post. There is also a makefile that will just run the analysis script required based on a change to the correct csv file.

Note currently the binary algorithm analysis takes a while (there's a bunch of data)...

License Information

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 license. You are free to:

  • Share: copy, distribute, and transmit the work,
  • Remix: adapt the work

Under the following conditions:

  • Attribution: You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
  • Share Alike: If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

When attributing this work, please include me.