Posts Tagged ‘recursion’

Some More about Recursion

Written by Raza. Posted in C++

recursion in programming


Deviating a little from our series of discussion on Sorting Algorithms, this time and maybe the next one too, we would be plunging into certain other core concepts considered vital and important to good programming. Last time, we carried out the Selection Sort using the recursive technique. As recursion is a tricky and fundamental topic and a very powerful tool as well, we would be having some more discussion on recursion now.

Example and Source Code for Quick Sort

Written by Raza. Posted in C++

pivot value of list in quick sort

In the previous post I elaborated on Quick Sort and its basic principles, recursive technique, how to select the pivot and the comparison of quick sort and bubble sort. Today I shall explain a sample problem step by step and then write a source code for it. As I mentioned, I would be considering the first element of the list as the pivot. Watch for the next paragraphs for step by step procedure and source code.

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.