Category Results  

Insertion Sort

    using System; namespace ZeroToCSharp { class Program { static void Main(string[] args) { int[] array = new int[6] { 24, 6, 26, 11, 15, 3 }; int key, comparer; for (int i = 1; i < array.Length; i++) { key = array[i]; comparer = i – 1; while(comparer >= 0 && array[comparer] > […]

Read More
Data Structure & AlgorithmsSorting Algorithms

Bubble Sort

    using System; namespace ZeroToCSharp { class Program { static void Main(string[] args) { int[] array = new int[6] { 24, 6, 26, 11, 15, 3 }; int temp; bool isSwapped; for (int i = 0; i < array.Length – 1; i++) { isSwapped = false; for (int j = 0; j < array.Length […]

Read More
Data Structure & AlgorithmsSorting Algorithms

Selection Sort

      using System; namespace ZeroToCSharp { class Program { static void Main(string[] args) { int[] array = new int[6] { 24, 6, 26, 11, 15, 3 }; int min, temp; for (int i = 0; i < array.Length – 1; i++) { min = i; for (int j = i + 1; j […]

Read More
Data Structure & AlgorithmsSorting Algorithms