Advertisement
wavec022

analysis

Feb 2nd, 2021
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. Analysis
  2.  
  3. "Recurrence Relation"
  4. T(n) = 2*T(n/2) + n ==> O(nlogn)
  5.  
  6. - 2 recursive calls on size n/2, logic that determines case
  7. - big O is kind of sloppy normally
  8.  
  9. T(0) = 1 usually (one way we are sloppy)
  10. we also treat the +n part with normal big O rules (simplified coefficients etc)
  11.  
  12. ===
  13.  
  14. Cheater's Theorem
  15. Master Theorem
  16.  
  17. T(n) = a*T(n/b) + n^d
  18.  
  19. if a < b^d then O(n^d)
  20. if a = b^d then O(n^d logn)
  21. if a > b^d then O(n^{log_b a})
  22.  
  23. T = 2*T(n/2) + n
  24. a = 2, b = 2, d = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement