Second “Working” HATs

Seminar date: February 18

“Big O” aka Complexity Analysis: O(1), O(N), O(N^2), O(log N), O(n log N)

  1. O(1): code that executes in the same amount of time no matter how big the array is
  2. O(N): linear search, perfect to find all values that match what you are searching for. You will have to look at each item in the array.
  3. O(N^2): Time to complete will be proportional to the square of the amount of data (nested iterations).
  4. O(log N): MUCH MORE EFFICIENT. Data is searched 50% each time the algorithm runs. (Binary Search)
  5. O(n log N): To figure out the number of comparisons needed, comparing and moving values without shifting values, compared only once.

Leave a comment