Skip to content

Recursive Sorts - Merge Sort, Selection Sort, Binar Sort and e.t.c

Notifications You must be signed in to change notification settings

tyom29/SortingAlgorithms.Recursive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Recursive Sorting Algorithms

This solution provides implementations of various sorting algorithms using recursive approaches.

Algorithms Implemented

  1. Bubble Sort (Recursive)
  2. Selection Sort (Recursive)
  3. Insertion Sort (Recursive)
  4. Merge Sort (Recursive)
  5. Quick Sort

Instructions

Each sorting algorithm is implemented as a static method within the ArraySort class. Below are brief instructions on how to use each algorithm:

1. Bubble Sort (Recursive)

ArraySort.BubbleSortRecursive(array, array.Length);

2. Selection Sort (Recursive)

ArraySort.SelectionSortRecursive(array, 0);

3. Insertion Sort (Recursive)

By Index:

ArraySort.InsertionSortRecursiveByIndex(array, 1);

By Length:

ArraySort.InsertionSortRecursiveByLength(array, array.Length);

4. Merge Sort

ArraySort.MergeSort(array, 0, array.Length - 1);

5. Quick Sort

ArraySort.QuickSort(array, 0, array.Length - 1);

Binary Search (Not a Sorting Algorithm)

This method is included in the solution but is not part of the sorting algorithms. It performs a binary search on a sorted array.

ArraySort.BinarySearch(sortedArray);

Example Usage

int[] array = { 5, 3, 8, 4, 2, 7, 1, 6 };
ArraySort.MergeSort(array, 0, array.Length - 1);
ArraySort.Show(array); // Output: 1 2 3 4 5 6 7 8

Note

Make sure to replace array with the array you want to sort in the example usage. Also, ensure that the array is properly initialized before passing it to any of the sorting methods.

About

Recursive Sorts - Merge Sort, Selection Sort, Binar Sort and e.t.c

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages