What is the best asymptotic runtime for the following function?
1 2 |
|
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
No matter how big x gets, it will always go through the same number of operations, simply multiplying the two numbers. Therefore, the function takes constant time.