Posts Tagged ‘sorting’

Selection Sort using Recursion

Written by Raza. Posted in C++

recursive process in computer

As I mentioned earlier, this time instead of advancing towards another Sorting Algorithm, we would discuss the previous one, that is, the selection sort algorithm in the light of Recursion. So let’s deliberate over recursion first.

Selection Sort, the Basic Sorting Algorithm

Written by Raza. Posted in C++

selection sort algorithm c++

 

Selection sort is one of the basic sorting Algorithms. It is pretty simple to understand and very good to implement on small amount of data. However, it becomes quite inefficient when working with large lists.  

Selection Sort uses the concept of in-place sorting. It means that the data is sorted by shuffling it within the list. First I shall try to explain the algorithm and then together we would try to carve out of it a basic source code.

Gnome Sort, a Variant of Insertion Sort

Written by Raza. Posted in C++

The Gnome Sort Algorithm

Last time, we discussed a sorting technique known as insertion sort. It is a very good sorting procedure and the simplest sorting algorithm for short lists and small amount of data. For larger lists, it’s running time increases exponentially which renders it inefficient. A number of variations have also been introduced to insertion sort, some of which are more efficient and some are equally good. Shell sort and Gnome Sort are two such variations. I prefer Gnome Sort so I will explain it to you in this article.