Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
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.
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.