static int[] unorderedList = {1,5,6,2,7,8,9,11,13,26,15,17};
public static void Main()
int[] list = orderList(unorderedList);
for(int i = 0; i < list.Length; i++){
listString += list[i] + " ";
Console.WriteLine(listString);
Console.WriteLine("-----------------------------");
Console.WriteLine(findMedian(list));
public static int[] orderList(int[] list){
for(int i=0; i<=list.Length-1; i++){
for(int j = i+1; j<list.Length; j++){
public static bool isEven(int number){
public static double findMedian(int[] array){
int length = array.Length;
index = (length - 2) / 2;
double result = (Convert.ToDouble((array[index] + array[index + 1])) / 2);
index = (length - 1 ) / 2;
int result = array[index];