williamxmejia / DSA-Practice

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Data Structures & Algorithms

Big O

  • Time Complexity: Measured in number of operations
  • Space Complexity: How much space the operation takes

Big O is always the worst case

  • O(n^2) = Loop within a loop
  • O(n) = proportional
  • O(log n) = Divide and conquer
  • O(1) = Constant, as n grows the number of operations remains constant

Extra

  • Drop Constants --> O(2n) = O(n) & O(n^3) = O(n^2)
  • Drop-non-dominants --> O(n^2 + n) = O(n^2)
  • Different terms for inputs --> O(a+b) & O(a * b)

Linked List vs Array List

About


Languages

Language:Java 86.6%Language:JavaScript 12.8%Language:HTML 0.6%