Right you are. I still am having trouble seeing how there is no order in shuffling increasingly small parts of an array, but results are results - I'll look in detail when I have more time.
Type: Posts; User: KBriggs
Right you are. I still am having trouble seeing how there is no order in shuffling increasingly small parts of an array, but results are results - I'll look in detail when I have more time.
Oops, yes, I did not use swap - I did not need it. I do the shuffling in the loop using the third array.
However, I stand corrected.
If this were true, then we could randomize the array N times, and take the average of the elemetns of the array over all those times, and assuming that the briefcases were uniformly distributed, we...
Doing that, won't you only swap elements at the end of the array with elements that are quite near? And the last element would not get swapped at all unless it happened to get swapped before. If the...
Did you try anything at all?
rand - C++ Reference