Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Selection sort
//Computer selection sort using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int[] ar={5,3,7,2,9,1,0,4,8,6}; int n=ar.Length; for(int x=0; x<n; x++) { int min_index=x; for(int y=x; y<n; y++) { if(ar[min_index]>ar[y]) { min_index=y; } } int temp=ar[x]; ar[x]=ar[min_index]; ar[min_index]=temp; } Console.WriteLine("Sort array in ascending order by using Selection Sort"); foreach(int i in ar) { Console.Write(i+", "); } } } }
run
|
edit
|
history
|
help
0
6
Single Line Date in Months
Fórum ➡ DataTable #1's rows that are NOT present in DataTable #2 ♦
Chris Kasongo Lazarius Mukengeshayi "Entelect BlackJack 21"
MegaWays3
BNV
123
if else y var
SortedDictionary : Add と foreach
dynamic object