Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (O(1))
- Even or Odd is of CONSTANT RUN TIME COMPLEXITY because there will only ever be one tick.
- O(n^k)
- Are You Here is of POLYNOMIAL RUN TIME COMPLEXITY because as the arrays increase, the ticks multiply.
- (O(n))
- doubleArrayValues has LINEAR RUN TIME COMPEXITY because for every 1 input in the array, the ticks increase by 1.
- (O(n))
- naiveSearch has LINEAR RUN TIME COMPLEXITY because for every 1 input in the array, the ticks increase by 1.
- (O(n^2))
- createPairs has POLYNOMIAL RUN TIME COMPLEXITY because as the arrays increase, the ticks multiply.
- (O(n))
- generateFib has LINEAR RUN TIME COMPLEXITY because for every 1 input in the array, the ticks increase by 1.
- (O(log n))
- 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.)
- (O(1))
- findRandomElement has CONSTANT RUN TIME COMPLEXITY because, obviously, it will always run a set number of time.
- (O(n))
- isPrime has LINEAR RUN TIME COMPLEXITY because the ticks increase proportionally with the array.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement