Ernest Friedman-Hill and Ilja Preuss
thanks you very much
it will run endlessly: O(infinity) I agree that in the worst case scenario, it will run endlessly.
It is probability question that when n-->infinity, the probability for generating the last unique random number n that assigns to an array a[infinity] is 1/infinity. I do not know how to write it in Big O notation
In the first (for loop) it is used in N times
In the second (for loop) it is used about N times
Within the second for loop, (if condition) will be infinity
So I do not know what is the Big O notation which will be O(
)
Ummm......Can I write it in O(infinity)?