selection sort c#
C#
using System;
public class Example {
static void Main(string[] args) {
int[] arr = new int[10] { 56, 1, 99, 67, 89, 23, 44, 12, 78, 34 };
int n = 10;
Console.WriteLine("Selection sort");
Console.Write("Initial array is: ");
for (int i = 0; i < n; i++) {
Console.Write(arr[i] + " ");
}
int temp, smallest;
for (int i = 0; i < n - 1; i++) {
smallest = i;
for (int j = i + 1; j < n; j++) {
if (arr[j] < arr[smallest]) {
smallest = j;
}
}
temp = arr[smallest];
arr[smallest] = arr[i];
arr[i] = temp;
}
Console.WriteLine();
Console.Write("Sorted array is: ");
for (int i = 0; i < n; i++) {
Console.Write(arr[i] + " ");
}
}
}
Also in C#:
- Title
- how to move towards an object unity
- Category
- C#
- Title
- what is a protected int c#
- Category
- C#
- Title
- Category
- C#
- Title
- is start called after dontdestroyonload
- Category
- C#
- Title
- C# datareadeer return null
- Category
- C#
- Title
- comments unity c#
- Category
- C#
- Title
- C# previous method
- Category
- C#
- Title
- c# odd even median
- Category
- C#
- Title
- how to switch scenes unity
- Category
- C#
- Title
- how to a equall to b in c#
- Category
- C#
- Title
- 5 second timer in c#
- Category
- C#
- Title
- Unity if object doens't exist
- Category
- C#
- Title
- unity rigidbody constraints
- Category
- C#
- Title
- array syntax c#
- Category
- C#
- Title
- c# getasync response
- Category
- C#
- Title
- .net core get image from url
- Category
- C#
- Title
- c# zip a file
- Category
- C#
- Title
- go right unity
- Category
- C#
- Title
- c# arraylist contains
- Category
- C#
- Title
- c# regex to find number between parenthesis
- Category
- C#
- Title
- how to get object to spawn in a curcle
- Category
- C#
- Title
- unity c# get bool from another script
- Category
- C#
- Title
- C# get pc language
- Category
- C#
- Title
- How do i destroy a prefab without the error?
- Category
- C#
- Title
- how to store some variables on the device in unity
- Category
- C#
- Title
- how to create a list in c# unity
- Category
- C#
- Title
- change partial view based on select asp.net core
- Category
- C#
- Title
- C# array index tostring
- Category
- C#
- Title
- c# filesystemwatcher double events
- Category
- C#
- Title
- c# int
- Category
- C#
- Title
- create expression func c# for use in where clause
- Category
- C#
- Title
- c# tostring mmm dd yyyy
- Category
- C#
- Title
- check if number is even or odd c#
- Category
- C#
- Title
- unity prevent system from creation
- Category
- C#
- Title
- reference to gameobject in different scene unity
- Category
- C#
- Title
- c# relaxed boolean cast
- Category
- C#
- Title
- c# adding to a list
- Category
- C#
- Title
- unity get max occurrence in list
- Category
- C#
- Title
- C# for
- Category
- C#
- Title
- c# compile into an exe
- Category
- C#
- Title
- asp net identity include phone number when registering
- Category
- C#
- Title
- c# md5 string
- Category
- C#
- Title
- unity find gameobject with layer
- Category
- C#
- Title
- unity load next scene
- Category
- C#
- Title
- beard styles without mustache Intitle:work with me
- Category
- C#
- Title
- response redirect new tab
- Category
- C#
- Title
- how to close a windows form application in c#
- Category
- C#
- Title
- unity check if gameobject is active
- Category
- C#
- Title
- ecs get specific entities with component
- Category
- C#
- Title
- c sharp string replace
- Category
- C#
- Title
- bulk update in c# using jquery datatble
- Category
- C#
- Title
- c# round number down
- Category
- C#
- Title
- c# global enumerator
- Category
- C#
- Title
- convert string to number C#
- Category
- C#
- Title
- C# downloadstirng download old
- Category
- C#
- Title
- F# convert generic.List to list
- Category
- C#
- Title
- c# yield
- Category
- C#
- Title
- iframe set html content c#
- Category
- C#
- Title
- c# read a webpage data
- Category
- C#
- Title
- font family behind code uwp c#
- Category
- C#
- Title
- c# list all files in a directory and subdirectory
- Category
- C#
- Title
- index in foreach c#
- Category
- C#
- Title
- visual studio C# hintergrund bild ändern
- Category
- C#
- Title
- c# dynamic object get value
- Category
- C#
- Title
- How can you learn C# on your own
- Category
- C#
- Title
- unity detect number key
- Category
- C#
- Title
- c# dictionary add
- Category
- C#
- Title
- remove items from list c# condition
- Category
- C#
- Title
- how to get joypad axis input unity
- Category
- C#
- Title
- array copy c#
- Category
- C#
- Title
- how to detect if a key is pressed in c#
- Category
- C#
- Title
- query associative table ef6
- Category
- C#
- Title
- unity key detection
- Category
- C#
- Title
- c# get directory part of path
- Category
- C#
- Title
- parsing object from text file c#
- Category
- C#
- Title
- C# events
- Category
- C#
- Title
- set current date to textbox in asp.net
- Category
- C#
- Title
- how to edit a c# list
- Category
- C#
- Title
- create new object from generic c#
- Category
- C#
- Title
- c# rsa example
- Category
- C#
- Title
- Unity C# instantiate prefab
- Category
- C#
- Title
- while loop in c#
- Category
- C#
- Title
- c# stop loop
- Category
- C#
- Title
- wpf make size fill all grid
- Category
- C#
- Title
- How to look at an object unity
- Category
- C#
- Title
- c# superclass constructor
- Category
- C#
- Title
- unity mobile controls
- Category
- C#
- Title
- download and run exe c# 1 button
- Category
- C#
- Title
- c# udpclient receive buffer size
- Category
- C#
- Title
- how to clamp transform.rotation
- Category
- C#
- Title
- c# how to compare 2 dates without time
- Category
- C#
- Title
- c# list.foreach
- Category
- C#
- Title
- how to exit a program in c#
- Category
- C#
- Title
- Could not load file or assembly 'Ubiety.Dns.Core, Version=2.2.1.0
- Category
- C#
- Title
- transform.Translate movement
- Category
- C#
- Title
- and unity
- Category
- C#
- Title
- unity scene name get
- Category
- C#
- Title
- unity how to change max fps
- Category
- C#
- Title
- modal dismiss
- Category
- C#
- Title
- parsing string to int c#
- Category
- C#