Tutorial by Examples

Shell sort, also known as the diminishing increment sort, is one of the oldest sorting algorithms, named after its inventor Donald. L. Shell (1959). It is fast, easy to understand and easy to implement. However, its complexity analysis is a little more sophisticated. The idea of Shell sort is the f...
public class ShellSort { static void SortShell(int[] input, int n) { var inc = 3; while (inc > 0) { int i; for (i = 0; i < n; i++) { var j = i; var temp = input[i]; w...

Page 1 of 1