What is a Sorting Algorithm?
 Sorting algorithm
 An algorithm that rearranges elements in a list
 In non-decreasing order
 Elements must be comparable more formally
 The input is a sequence / list of elements
 The output is an rearrangement / permutation of elements
 In non-decreasing order
This are the 6 Types of Sorting
Algorithm that we have represented
 Bubble Sort
 Selection Sort
 Insertion Sort
 Merge Sort
 Quick Sort
 Heap Sort
Bubble Sort
Bubble sort is a basic algorithm for arranging a string of
numbers or other elements in the correct order. The method works
by examining each set of adjacent elements in the string, from
left to right, switching their positions if they are out of order.
Working of Bubble Sort
A bubble sort algorithm goes through a list of data a number of
times, comparing two items that are side by side to see which is
out of order. It will keep going through the list of data until all the
data is sorted into order. Each time the algorithm goes through the
list it is called a 'pass’.
Selection Sort
Selection sort is an effective and efficient sort algorithm based
on comparison operations. It adds one element in each iteration.
You need to select the smallest element in the array and move it
to the beginning of the array by swapping with the front element.
Working of Selection Sort
Selection sort works by taking the smallest element in an
unsorted array and bringing it to the front. You'll go through each
item (from left to right) until you find the smallest one. The first
item in the array is now sorted, while the rest of the array is
unsorted.
Insertion Sort
Insertion sort is a simple sorting algorithm that works similar to
the way you sort playing cards in your hands. The array is virtually
split into a sorted and an unsorted part. Values from the unsorted
part are picked and placed at the correct position in the sorted
part.
Working of Insertion Sort
Insertion sort is a simple sorting algorithm that works similar to
the way you sort playing cards in your hands. The array is virtually
split into a sorted and an unsorted part. Values from the unsorted
part are picked and placed at the correct position in the sorted
part.
Merge Sort
Merge sort is one of the most efficient sorting algorithms. It is
based on the divide-and-conquer strategy. Merge sort continuously
cuts down a list into multiple sub-lists until each has only one
item, then merges those sub-lists into a sorted list.
Working of Merge Sort
In the context of sorting elements in a list and in ascending
order, the merge sort method divides the list into halves, then
iterates through the new halves, continually dividing them down
further to their smaller parts.
Quick Sort
Like Merge Sort, Quick Sort is a Divide and Conquer algorithm It
picks an element as a pivot and partitions the given array around
the picked pivot. There are many different versions of Quick Sort
that pick pivot in different ways.
Working of Merge Sort
Quicksort is one of the most efficient sorting algorithms. It
works by breaking an array (partition) into smaller ones and
swapping (exchanging) the smaller ones, depending on a
comparison with the 'pivot' element picked.
Heap Sort
Heap sort is a comparison-based sorting technique based
on Binary Heap data structure. It is similar to the selection
sort where we first find the minimum element and place the
minimum element at the beginning. Repeat the same process for
the remaining elements.
Working of Heap Sort
Heapsort is a comparison based sorting technique, where data
structure Binary Heap is used. This sorting is almost the same as
that of selection sort, where the largest element will be selected,
and places in the end, and the process will be repeated for all the
elements.

What is a Sorting Algorithm Ishank mini project.pptx

  • 1.
    What is aSorting Algorithm?  Sorting algorithm  An algorithm that rearranges elements in a list  In non-decreasing order  Elements must be comparable more formally  The input is a sequence / list of elements  The output is an rearrangement / permutation of elements  In non-decreasing order
  • 2.
    This are the6 Types of Sorting Algorithm that we have represented  Bubble Sort  Selection Sort  Insertion Sort  Merge Sort  Quick Sort  Heap Sort
  • 3.
    Bubble Sort Bubble sortis a basic algorithm for arranging a string of numbers or other elements in the correct order. The method works by examining each set of adjacent elements in the string, from left to right, switching their positions if they are out of order. Working of Bubble Sort A bubble sort algorithm goes through a list of data a number of times, comparing two items that are side by side to see which is out of order. It will keep going through the list of data until all the data is sorted into order. Each time the algorithm goes through the list it is called a 'pass’.
  • 4.
    Selection Sort Selection sortis an effective and efficient sort algorithm based on comparison operations. It adds one element in each iteration. You need to select the smallest element in the array and move it to the beginning of the array by swapping with the front element. Working of Selection Sort Selection sort works by taking the smallest element in an unsorted array and bringing it to the front. You'll go through each item (from left to right) until you find the smallest one. The first item in the array is now sorted, while the rest of the array is unsorted.
  • 5.
    Insertion Sort Insertion sortis a simple sorting algorithm that works similar to the way you sort playing cards in your hands. The array is virtually split into a sorted and an unsorted part. Values from the unsorted part are picked and placed at the correct position in the sorted part. Working of Insertion Sort Insertion sort is a simple sorting algorithm that works similar to the way you sort playing cards in your hands. The array is virtually split into a sorted and an unsorted part. Values from the unsorted part are picked and placed at the correct position in the sorted part.
  • 6.
    Merge Sort Merge sortis one of the most efficient sorting algorithms. It is based on the divide-and-conquer strategy. Merge sort continuously cuts down a list into multiple sub-lists until each has only one item, then merges those sub-lists into a sorted list. Working of Merge Sort In the context of sorting elements in a list and in ascending order, the merge sort method divides the list into halves, then iterates through the new halves, continually dividing them down further to their smaller parts.
  • 7.
    Quick Sort Like MergeSort, Quick Sort is a Divide and Conquer algorithm It picks an element as a pivot and partitions the given array around the picked pivot. There are many different versions of Quick Sort that pick pivot in different ways. Working of Merge Sort Quicksort is one of the most efficient sorting algorithms. It works by breaking an array (partition) into smaller ones and swapping (exchanging) the smaller ones, depending on a comparison with the 'pivot' element picked.
  • 8.
    Heap Sort Heap sortis a comparison-based sorting technique based on Binary Heap data structure. It is similar to the selection sort where we first find the minimum element and place the minimum element at the beginning. Repeat the same process for the remaining elements. Working of Heap Sort Heapsort is a comparison based sorting technique, where data structure Binary Heap is used. This sorting is almost the same as that of selection sort, where the largest element will be selected, and places in the end, and the process will be repeated for all the elements.