mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-22 04:42:10 +08:00
Documentation for 95ed72a452
This commit is contained in:
@@ -139,7 +139,7 @@ Functions</h2></td></tr>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p >Implementation of the <a href="https://en.wikipedia.org/wiki/Selection_sort" target="_blank">Selection sort</a> implementation using recursion. </p>
|
||||
<p >The selection sort algorithm divides the input list into two parts: a sorted sublist of items which is built up from left to right at the front (left) of the list, and a sublist of the remaining unsorted items that occupy the rest of the list. Initially, the sorted sublist is empty, and the unsorted sublist is the entire input list. The algorithm proceeds by finding the smallest (or largest, depending on the sorting order) element in the unsorted sublist, exchanging (swapping) it with the leftmost unsorted element (putting it in sorted order), and moving the sublist boundaries one element to the right.</p>
|
||||
<h3><a class="anchor" id="autotoc_md101"></a>
|
||||
<h3><a class="anchor" id="autotoc_md102"></a>
|
||||
Implementation</h3>
|
||||
<p >FindMinIndex This function finds the minimum element of the array(list) recursively by simply comparing the minimum element of array reduced size by 1 and compares it to the last element of the array to find the minimum of the whole array.</p>
|
||||
<p >SelectionSortRecursive Just like selection sort, it divides the list into two parts (i.e.: sorted and unsorted) and finds the minimum of the unsorted array. By calling the <code>FindMinIndex</code> function, it swaps the minimum element with the first element of the list, and then solves recursively for the remaining unsorted list. </p><dl class="section author"><dt>Author</dt><dd><a href="https://github.com/Tushar-K24" target="_blank">Tushar Khanduri</a> </dd></dl>
|
||||
|
||||
Reference in New Issue
Block a user