The following statement is valid.
log(n!) = (n log n).
Explanation: Order of growth of and is same for large values of , i.e., . So time complexity of fun() is .
The expression can be easily derived from following Stirling’s approximation (or Stirling’s formula).