Skip to main content
1 of 2
Jörg W Mittag
  • 104.7k
  • 24
  • 226
  • 327

The worst-case is O(∞). The best-case is O(n2), because you have to generate n numbers, and for each number generated you have to search a list of length n whether or not the number is already in there.

Jörg W Mittag
  • 104.7k
  • 24
  • 226
  • 327