Untitled

mail@pastecode.io avatar
unknown
csharp
a year ago
566 B
1
Indexable
Never
using System;
using System.Threading;

class Program {
    static void Main(string[] args) {
        int[] numbers = new int[] { 5, 2, 7, 1, 9, 3 };
        Thread t1 = new Thread(() => Array.Sort(numbers, 0, numbers.Length / 2));
        Thread t2 = new Thread(() => Array.Sort(numbers, numbers.Length / 2, numbers.Length / 2));
        t1.Start();
        t2.Start();
        t1.Join();
        t2.Join();
        Array.Sort(numbers);
        Console.WriteLine("Sorted numbers: " + string.Join(", ", numbers));
        Console.ReadLine();
    }
}