-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathTest.cs
More file actions
43 lines (40 loc) · 1.08 KB
/
Test.cs
File metadata and controls
43 lines (40 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
public class Test
{
public static void IntegerTest()
{
//declaring and instantiating a test array of unsorted numbers
int[] test = new int[9];
test[0] = 6;
test[1] = 4;
test[2] = 7;
test[3] = 2;
test[4] = 8;
test[5] = 9;
test[6] = 1;
test[7] = 3;
test[8] = 5;
//Declaring and instantiating the sort object
InsertionSort sorting = new InsertionSort();
//calling the sort method and assigning the returned array to the result array
int[] result = sorting.sort(test);
//Cycle through and print the result array
for (int i = 0; i < result.Length; i++)
{
Console.WriteLine(result[i]);
}
}
public static void StringTest()
{
String[] lines = System.IO.File.ReadAllLines("english.txt");
//Declaring and instantiating the sort object
InsertionSort sorting = new InsertionSort();
//calling the sort method and assigning the returned array to the result array
int[] result = sorting.sort(test);
//Cycle through and print the result array
/* for (int i = 0; i < result.Length; i++)
{
Console.WriteLine(result[i]);
}*/
}
}