// From the software distribution accompanying the textbook // "A Practical Introduction to Data Structures and Algorithm Analysis, // Third Edition (C++)" by Clifford A. Shaffer. // Source code Copyright (C) 2007-2011 by Clifford A. Shaffer. // Randomly permute the "n" values of array "A" template void permute(E A[], int n) { for (int i=n; i>0; i--) swap(A, i-1, Random(i)); }