using System; namespace PS5_Q2 { // // Problem Set 5, Question 2 // Written by Paul Hudak // October 16, 2006 // class Class1 { // // A Sorting Program, using the Bubblesort Algorithm // [STAThread] static void Main(string[] args) { // Test the sorting method by generating a large array // containing random elements. // put the array size in one place so that it can be changed int size = 1000; // create the random array Random randGen = new Random(); int[] atest = new int[size]; for (int i=0; ia[j+1]) swap(a,j,j+1); }; } private static void swap(int[] a, int i, int j) { // swap elements a[i] and a[j] int temp = a[i]; a[i] = a[j]; a[j] = temp; } public static void DisplayArray(int[] a) { // very simple method for displaying the contents of an array for (int i=0; i