سلام بر برنامه نویسان عزیز با یه کد سی شارپ دیگه در خدمتتون هستم.امیدوارم که از این استفاده کافی رو ببرید.
//مرتب سازی انتخابی در سی شارپ
static void Main(string[] args)
{
Console.WriteLine("Selection Sort");
int[] arr = { 2, 6, 1, 4, 3, 8 };
print(arr, "Unsorted Array");
int[] sorted = selectionSort(arr, arr.Length);
print(sorted, "sorted Array");
Console.ReadLine();
}
static int[] selectionSort(int[] arr, int n)
{
int temp = 0;
for (int i = 0; i < n; i++)
{
for (int j = i + 1; j < n; j++)
{
if (arr[i] > arr[j])
static void Main(string[] args)
{
Console.WriteLine("Selection Sort");
int[] arr = { 2, 6, 1, 4, 3, 8 };
print(arr, "Unsorted Array");
int[] sorted = selectionSort(arr, arr.Length);
print(sorted, "sorted Array");
Console.ReadLine();
}
static int[] selectionSort(int[] arr, int n)
{
int temp = 0;
for (int i = 0; i < n; i++)
{
for (int j = i + 1; j < n; j++)
{
if (arr[i] > arr[j])