Sorting Algorithms (WIP)

Sorting algorithms are methods used to rearrange a list of elements in a particular order, typically in ascending or descending order. They are fundamental in computer science and are used in various applications, such as searching, data analysis, and database management.

1- Bubble Sort: A simple comparison-based algorithm where each pair of adjacent elements is compared, and the elements are swapped if they are in the wrong order. This process is repeated until the list is sorted.

2- QuickSort: A divide-and-conquer algorithm that selects a 'pivot' element from the array and partitions the other elements into two sub-arrays, according to whether they are less than or greater than the pivot. The sub-arrays are then sorted recursively.

3- Merge Sort: Another divide-and-conquer algorithm that divides the list into two halves, recursively sorts each half, and then merges the two sorted halves back together.

4- Heap Sort: A comparison-based sorting technique based on a binary heap data structure. It involves building a heap from the input data and then repeatedly extracting the maximum element from the heap and rebuilding the heap until all elements are sorted.

5- Counting Sort: A non-comparison-based sorting algorithm that works by counting the number of occurrences of each distinct element in the input list. The count is then used to place the elements in the correct position in the output list.