Skip to content

Commit ffd01d5

Browse files
ClémentClément
authored andcommitted
Adding missing file to sorting solution.
1 parent 6d181a3 commit ffd01d5

File tree

1 file changed

+36
-0
lines changed
  • source/code/projects/Sorting/Sorting

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.Collections.Generic;
3+
4+
static class Demo
5+
{
6+
private const int LIST_SIZE = 30;
7+
8+
public static void Run(Action<List<int>> sortingAlgo)
9+
{
10+
List<int> test = new List<int>();
11+
Random gen = new Random();
12+
for (int i = 0; i < LIST_SIZE; i++)
13+
{
14+
test.Add(gen.Next(50));
15+
}
16+
Displaying<int>.List(test);
17+
sortingAlgo(test);
18+
Displaying<int>.After(test);
19+
}
20+
21+
public static void Run(Action<List<char>> sortingAlgo)
22+
{
23+
List<char> test = new List<char>();
24+
Random gen = new Random();
25+
26+
for (int i = 0; i < LIST_SIZE; i++)
27+
{
28+
test.Add((char)(gen.Next(33, 127)));
29+
}
30+
Displaying<char>.List(test);
31+
sortingAlgo(test);
32+
Displaying<char>.After(test);
33+
}
34+
35+
36+
}

0 commit comments

Comments
 (0)