To help you better understand why the definition of Big-O is concerned only with the behavior of functions for large values ofn, choose two functions with different growth rates in which the faster growing function is lower at small values ofn, but eventually becomes larger. Write a short program that periodically compares the values of the two functions and illustrates the point at which the faster growing function overtakes the slower growing one. As an example, consider the following two functions:
Shown below is a table of the values of both functions for small values ofn.
n f(n) g(n) XXXXXXXXXX2000 XXXXXXXXXX16000 XXXXXXXXXX54000 XXXXXXXXXX128000 XXXXXXXXXX250000 XXXXXXXXXX432000 XXXXXXXXXX686000 XXXXXXXXXX1024000 XXXXXXXXXX1458000 XXXXXXXXXX2000000 XXXXXXXXXX2662000 XXXXXXXXXX3456000 XXXXXXXXXX4394000 XXXXXXXXXX5488000 XXXXXXXXXX6750000 XXXXXXXXXX8192000 XXXXXXXXXX9826000 XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX
Oncenreaches 260govertakesf.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here