1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 namespace BubbleSort
6 {
7 class Program
8 {
9 static void Main(string[] args)
10 {
11 TestArray nums = new TestArray(10);
12 #region 初始化數組
13 Random rnd = new Random(100);
14 for (int num = 0; num < 10; num++)
15 {
16 nums.Insert(rnd.Next(0,100));
17 }
18 #endregion
19 Console.WriteLine("Before Sorting: ");
20 nums.DisplayElements();
21 Console.WriteLine("Durring Sorting: ");
22 nums.InsertionSort();
23 Console.WriteLine("After Sorting: ");
24 nums.DisplayElements();
25 Console.ReadLine();
26 }
27 }
28