Suppose that the assignment to random-Index in the Random-One-Of function (Figure 17.2) were replaced by the following:

Question:

Suppose that the assignment to random-Index in the Random-One-Of function (Figure 17.2) were replaced by the following:
randomIndex = RandomInt(0, list.length);
Would this modification cause the function to return an error? Would the function still behave appropriately every time it is called? Explain.
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: