Posts

Showing posts from September, 2017

Sorting Algotithms

Image
Sorting is the basic operation required in most of the programs. For this which is used in right manner, the algorithm should be efficient and optimized. We have various algorithms from low to high efficiency. Selection Sort: In place logic of selecting the minimum in each pass and putting it in its appropriate place. References: Mycodeschool channel-youtube. http://www.youtube.com/playlist?list=PL2_aWCzGMAwKedT2KfDMB9YA5DgASZb3U Merge Sort: Mergesort is a comparison-based algorithm that focuses on how to merge together two pre-sorted arrays such that the resulting array is also sorted. Insertion Sort: Insertion sort is a comparison-based algorithm that builds a final sorted array one element at a time. It iterates through an input array and removes one element per iteration, finds the place the element belongs in the array, and then places it there. Bubble Sort:   Bubble sort is a comparison​-based algorithm that compares each pair of elements in an array and swaps