Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
shell sort
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; private void SortArrayWithShellSort() { int[] array = { 297,183, 464 }; ShellSort(array); } private void ShellSort(int[] array) { int n = array.Length; int gap = n / 2; int temp; while (gap > 0) { for (int i = 0; i + gap < n; i++) { int j = i + gap; temp = array[j]; while (j - gap >= 0 && temp < array[j - gap]) { array[j] = array[j - gap]; j = j - gap; } array[j] = temp; } gap = gap / 2; } }
run
|
edit
|
history
|
help
0
Recursive 2
Multidimensional Arrays
Armstrong
Enemy Spawner
C# queue
Z_non_pow
simpleDelegate
asifuesire
Swap w/o third var
Luhn Formula Demo C#