Sunday, September 16, 2018

Sorting Algorithms

  1. Merge Sort: It is divider and conquer technique.
    1. Divide the array into two halves using MergeSort() function.
    2. Merge the two sub arrays into single in sorted order using Merge() function.
    3. Merge sort program in c#
    4. Time complexity O(n logn).
  2. Insertion Sort:
    1. Its like Playing cards., take an element, Find location / index to insert this new element, by Comparing with all existing elements.
    2. InsertionSort in C#
    3. Time complexity O(n * n).
  3. Selection Sort:
    1. Sorts an array by repeatedly finding the minimum element from unsorted part of array.
    2. Selection sort in c#
    3. Time complexity O(n * n).

No comments:

Post a Comment