Main Article Content
Comparative Analysis of the Functions 2n, n! and nn
Abstract
In this paper, we have attempted to do comparative analysis of the following functions: 2n, n! and nn. We analyzed these functions, discussed how the functions can be computed and also studied how their computational time can be derived. The paper also discussed how to evaluate a given algorithm and determine its time complexity and memory complexity using graphical representation of the various functions, displaying how the function behaves graphically. However, it was noticed that when data are inputted into these functions, they gave cumbersome outputs that make it impossible to determine the execution (computational) time for the functions. We plotted a graph by taking a snapshot of the integer values n = 1 to 10 to compute the functions of 2n, n!, nn. From the graph, we noticed that 2n function had lower growth value; nn had the largest growth value and n! had slightly greater increase in growth than the 2n function. From our result, the execution time cannot be computed due to the largeness of the outputs.
However, we were able to determine the function with the highest computing time and discovered that the time growth for the functions differs from one to the other.
Keywords Algorithm, Pseudo code, Exponential functions, Recursion, Complexity.
However, we were able to determine the function with the highest computing time and discovered that the time growth for the functions differs from one to the other.
Keywords Algorithm, Pseudo code, Exponential functions, Recursion, Complexity.