Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. (O(1))
  2. Even or Odd is of CONSTANT RUN TIME COMPLEXITY because there will only ever be one tick.
  3.  
  4. O(n^k)
  5. Are You Here is of POLYNOMIAL RUN TIME COMPLEXITY because as the arrays increase, the ticks multiply.
  6.  
  7. (O(n))
  8. doubleArrayValues has LINEAR RUN TIME COMPEXITY because for every 1 input in the array, the ticks increase by 1.
  9.  
  10. (O(n))
  11. naiveSearch has LINEAR RUN TIME COMPLEXITY because for every 1 input in the array, the ticks increase by 1.
  12.  
  13. (O(n^2))
  14. createPairs has POLYNOMIAL RUN TIME COMPLEXITY because as the arrays increase, the ticks multiply.
  15.  
  16. (O(n))
  17. generateFib has LINEAR RUN TIME COMPLEXITY because for every 1 input in the array, the ticks increase by 1.
  18.  
  19. (O(log n))
  20. efficientSearch has LOGARITHMIC RUN TIME COMPLEXITY because although more arr.length increases ticks more than just constant, it's still not all the time (less than linear.)
  21.  
  22. (O(1))
  23. findRandomElement has CONSTANT RUN TIME COMPLEXITY because, obviously, it will always run a set number of time.
  24.  
  25. (O(n))
  26. isPrime has LINEAR RUN TIME COMPLEXITY because the ticks increase proportionally with the array.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement