Engrain by ByteRush

DSA.02.01 JuniorCore — asked often

Big-O, Big-Θ, Big-Ω in plain words

Comes up in: DSA, Recruiter screen

This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.

What it covers

  • growth rates (1, log n, n, n log n, n², 2ⁿ, n!)
  • dropping constants and lower terms
  • best/average/worst case
  • counting loops
  • nested loops
  • input size from constraints (n ≤ 10⁵ ⇒ O(n log n))

Words you will know

time complexityBig-Oworst casegrowth rate

What you will practise

  • analyse 12 snippets

Interview questions this answers

  • What is the time complexity of your solution? Can you do better?
  • What is amortised time complexity? Give an example.
  • Given n ≤ 10⁵, which complexities are acceptable?