luis-agm
7/23/2017 - 2:19 AM

Notable Complexity Functions

Notable Complexity Functions

function factorial(n) {
  if (n === 0) {
    return 1;
  }
  return n * factorial(n - 1);
}

function notableFunctions(n){
  console.log('n log n: ',n * Math.log10(n));
  console.log('log n: ',Math.log10(n));
  console.log('n^2: ',Math.pow(n,2));
  console.log('2^n: ',Math.pow(2,n));
  console.log('n!: ', factorial(n));
}

notableFunctions(5)