Skip to content

Commit

Permalink
Update sorting/selection_sort_recursive.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: David Leal <halfpacho@gmail.com>
  • Loading branch information
Tushar-K24 and Panquesito7 authored Sep 3, 2021
1 parent 6c18dde commit 8f466c8
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions sorting/selection_sort_recursive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,6 @@
/**
* @namespace sorting
* @brief Sorting algorithms
* 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 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.
*
* Implementation
* 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.
*
* 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 FindMinIndex, swaps the minimum element with the first element of the list and then
* solves recursively for the remaining unsorted list.
*/
namespace sorting
{
Expand Down

0 comments on commit 8f466c8

Please sign in to comment.