Professional Documents
Culture Documents
Sorting Techniques in Data Structures: in Partial Fulfilment of The Requirements For The Award of The
Sorting Techniques in Data Structures: in Partial Fulfilment of The Requirements For The Award of The
Sorting Techniques in Data Structures: in Partial Fulfilment of The Requirements For The Award of The
Structures
Summer Internship Report
Submitted to:
Sharda University
in
By
Raghav Gupta
2018004539
I hereby declare that the project entitled “Sorting Techniques in data structures” submitted for
the course of Summer Internship Project, is my original work. I have adequately cited and
referenced the original sources. I also declare that I have adhered to all principles of academic
honesty and integrity and have not misrepresented or fabricated or falsified any
idea/data/fact/source in my submission. I understand that any violation of the above will be
cause for disciplinary action by the University and can also evoke penal action from the
sources which have thus not been properly cited or from whom proper permission has not
been taken when needed.
ii
CERTIFICATE
It is certified that the work contained in the project report titled “Sorting Techniques in data
structures” by “Raghav Gupta” has been carried out under my supervision and that this work
has not been submitted elsewhere.
iii
ACKNOWLEDGEMENT
iv
TABLE OF CONTENTS
Title Page i
1. INTRODUCTION 1
2. LEARNING OUTCOMES 2
2.1 Related Work 2
3. References 5
v
CHAPTER 1
INTRODUCTION
The code that I’ve done and will be showing here, is implemented during my summer
internship program. As we know that sorting in any language is essential for performing
several operations and arranging the values in ascending or descending order. The program
will be used for making comparisons in between different sorting algorithms and thus, will be
efficient as will allow us to know the best sorting algorithm for each input case.
Here, I’ve taken different sorting algorithms which all
perform the same function by different methods thus performs different number of
comparisons.
Bubble Sort: In bubble sort iterations are done and adjacent elements are swapped based
upon their respective positions in the correct order of the elements. the iterations are repeated
as much number of times the elements.
Quick Sort: In quicksort a pivot element is selected and the other elements are placed
to their correct position based on the position of the pivot element iterations are repeated
by selecting pivot element differently.
Selection Sort: In selection sort every time the minimum element is searched from the
array and it is placed in the beginning of the array. this step is repeated for every element.
Insertion Sort: In insertion sort two sub arrays are created named as sorted subarray and
unsorted subarray.
Elements from the unsorted subarray are placed in their correct position in the sorted
subarray and it is repeated until the unsorted subarray merges into the sorted subarray
Merge Sort: Merge sort follows the principle of divide and conquer that it divides the array
repeatedly into subarrays of one or two element then arranging them according to the correct
order of elements and merging the subarrays into a single array.
Counting Sort: Counting sort works only when the range of element is given and taking an
auxiliary array and counting the number of elements before the respective element in the array
is sorted.
Radix Sort: Radix sort works when the base of the elements is given and arranging the
elements according to their digits in the correct order the array is sorted
1
CHAPTER 2
1. LEARNING OUTCOMES
There are various research papers written for comparative study of sorting algorithms. Like a
similar work is available on research gate website as a research paper from faculty of
University of waterloo. The aim is to suggest the best and efficient sorting algorithm. They
have used median, heap, and quick sort techniques for determining performance. The
implementation was also been done in C language. By this way they can adopt good sorting
technique for grid computing.
The link for the paper on research gate for reference is: -
https://www.researchgate.net/publication/288825600_A_Comparative_Study_of_Sorting_Al
gorithms#:~:text=Abstract,the%20most%20efficient%20sorting%20algorithm.&text=The%2
0number%20of%20sorting%20algorithms,%2C%20insertion%2C%20and%20selection%20s
orting.
The above given tables show the achieved outcome of the proposed work of the paper.
There are various other works as well like Sorting Algorithms – A Comparative Study
(https://www.researchgate.net/publication/315662067_Sorting_Algorithms_-
_A_Comparative_Study ).
2
CHAPTER 2
LEARNING OUTCOMES
There are various sorting algorithms which does the same thing of re-arrangement of list
items in ascending or descending order. Thus, the code helps us to determine which sorting
algorithm is better among them all in no. of comp. they do they do. The larger number of
comparisons will lead to a greater number of execution of loops and hence greaterthe time
taken.
1
CHAPTER 2
LEARNING OUTCOMES
The main application of these sorting algorithms is not stand alone but rather these are used
in different other problems for making them easily solvable.
2
2. REFERENCES