Skip to main content
Proper notation for best case is Big-Omega (Ω)
Source Link
user22815
user22815

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.

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.

The worst-case is O(∞). The best-case is Ω(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.

Source Link
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.