Skip to main content
1 of 3
zkutch
  • 2.4k
  • 1
  • 8
  • 14

Most simple example gives nested cycles: we now that, if we want, for example, find similar elements for 2 arrays, then we used 2 nested loops and therefore we have $O(n^2)$ complexity.

Hence, every 4 nested loops gives complexity $O(n^4)$.

zkutch
  • 2.4k
  • 1
  • 8
  • 14