Skip to content

Implementation of time complexity and curve fitting algorithms.

Notifications You must be signed in to change notification settings

JasonBallantyne/TimeComplexityAlgorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

TimeComplexityAlgorithms

This notebook carries out the following tasks:

  1. Write an algorithm to compute the factorial of a positive integer n.
  2. For different values of n, we compute and plot the running time as a function of n for non-tail recursion, tail recursion and an iterative approach.
  3. Using a sequence obtained from above, we implement the linear search and the iterative binary search methods.
  4. For each approach, we compute the best and worst running times and give examples by plotting running time as a function of n.
  5. Use curve fitting algorithms to find the equation of the running times obtained from the previous tasks.