Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
77 views

Sorting Algorithms

The document discusses various sorting algorithms such as insertion sort, selection sort, bubble sort, merge sort, and counting sort. Sorting is a fundamental concept that many algorithms are built upon, and understanding how sorting algorithms work is important for implementing efficient solutions to real-world problems. Code examples for each algorithm are provided with links to view the full Python code on GitHub.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views

Sorting Algorithms

The document discusses various sorting algorithms such as insertion sort, selection sort, bubble sort, merge sort, and counting sort. Sorting is a fundamental concept that many algorithms are built upon, and understanding how sorting algorithms work is important for implementing efficient solutions to real-world problems. Code examples for each algorithm are provided with links to view the full Python code on GitHub.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Sorting Algorithms

Rakin Mohammad Sifullah

Mail : rakin.sifullah@gmail.com
GitHub : https://github.com/sifullahrakin
1

Index :

Sl. Algorithm Name Page number

1 Sorting 02

2 Insertion Sort 03

3 Selection Sort 04

4 Bubble Sort 05

5 Merge Sort 06

6 Counting Sort 07
2

Sorting
Sorting is a basic building block that many other algorithms are built upon. It’s related to
several exciting ideas that you’ll see throughout your programming career. Understanding
how sorting algorithms in Python work behind the scenes is a fundamental step toward
implementing correct and efficient algorithms that solve real-world problems.

Some Sorting algorithms are -

1. Insertion Sort
2. Selection Sort
3. Bubble Sort
4. Merge Sort
5. Counting Sort
3

1. 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.

Code Link :
https://github.com/sifullahrakin/Searching-and-Sorting-Algorithms-Python-/blob/main/In
sertion%20Sort
4

2. Selection Sort

Selection sort is another sorting technique in which we find the minimum element in
every iteration and place it in the array beginning from the first index. Thus, a selection
sort also gets divided into a sorted and unsorted subarray.

Code Link :
https://github.com/sifullahrakin/Searching-and-Sorting-Algorithms-Python-/blob/main/Se
lection%20Sort
5

3. Bubble Sort
Sort by comparing each adjacent pair of items in a list in turn, swapping the items if
necessary, and repeating the pass through the list until no swaps are done. Also known as
sinking sort, exchange sort.

Code Link :
https://github.com/sifullahrakin/Searching-and-Sorting-Algorithms-Python-/blob/main/B
ubble%20Sort
6

4. Merge Sort
Merge sort is one of the most efficient sorting algorithms. It works on the principle of
Divide and Conquer. Merge sort repeatedly breaks down a list into several sublists until
each sublist consists of a single element and merging those sublists in a manner that
results in a sorted list.

Code Link :
https://github.com/sifullahrakin/Searching-and-Sorting-Algorithms-Python-/blob/main/M
erge%20Sort
7

5. Counting Sort
Counting sort is a sorting technique based on keys between a specific range. It works by
counting the number of objects having distinct key values.

Code Link :
https://github.com/sifullahrakin/Searching-and-Sorting-Algorithms-Python-/blob/main/C
ounting%20Sort
8

References :

1. Data Structure & Algorithms by Goodrich, Tamassia and Goldwasser


2. https://www.geeksforgeeks.org/
3. Programming contest, Data structure and Algorithms by Mahbubul Hasan

You might also like