DSU Microproject
DSU Microproject
A
MICROPROJECT REPORT
ON
“Sorting Operation ”
Subject - DSU
SUBMITTED
BY
BRIEF INTRODUCTION: -
Sorting is one of the operations which we can perform on data structure to arrange data
elements in ascending and descending order. It is a process of rearranging data elements
in an array or list in order to make it easier to search and retrieve. By sorting in data
structure, the complexity of searching for a particular item is reduced.
Name of
Sr. No. Specifications QTY Remarks
Resources
Hardware:
1. Computer CPU - Ryzen 3 1200
system RAM - 8 GB For all
Storage Required - At Practical
As per
most 1 GB of Test
batch
size Case
genera-
tion.
2. Operating
system Windows 10 Pro
3. Software
Microsoft Word 2010 or above
for report
Any photo editing software to
create cover page
PART B – PLAN
BRIEF INTRODUCTION:-
Sorting is one of the operations which we can perform on data structure to arrange data
elements in ascending and descending order. It is a process of rearranging data elements
in an array or list in order to make it easier to search and retrieve. By sorting in data
structure, the complexity of searching for a particular item is reduced.
Finding information about the sorting algorithms and writing them down.
Group Information:
After attending the feature of two weeks, we were able to select the
topic for micro project. We discussed the topic with our guide,
regarding the concept which we are going to apply in the project. We
individually tried to explain the basic platform of project.
Planning:
From finalizing the project, we, the group members, started working on
the project. We started the planning phase. We discussed among
ourselves regarding the resource such as hardware and software
requirement. In third week of March, we completed the Part A plan of
the microproject.
Module Distribution And Analysis Part:
Design Part:
In this part, we tested the each module and get the actual result for our
micro project. By doing this we were clearer of the project.
Submission:
First week of October was the submission week, we have to submit the
project to the guide. We have to complete both the Part A and Part B
plan of project. We also have to submit the soft copy of project to the
guide.
Name of
Sr. No. Specifications QTY Remarks
Resources
Hardware:
1. Computer CPU - Ryzen 3 1200
system RAM - 8 GB For all
Storage Required - At Practical
As per
most 1 GB of Test
batch
size Case
genera-
tion.
2. Operating
system Windows 10 Pro
3. Software
Microsoft Word 2010 or above
for report
Any photo editing software to
create cover page
Output
Of The
Micro-
Project
Introduction to Sorting:-
What is Sorting?
Sorting is one of the operations which we can perform on data structure to arrange
data elements in ascending and descending order. It is a process of rearranging data
elements in an array or list in order to make it easier to search and retrieve. By
sorting in data structure, the complexity of searching for a particular item is
reduced.
There are different methods that can be used to arrange data in ascending or
descending order.
1. Internal Sorting:
Internal Sorting is used when the data to be sort, all stored in main
memory.
Bubble Sort, Selection Sort, Insertion Sort, Quick Sort, Radix Sort are
internal sorting techniques
2. External Sorting:
If all the data that is to be sorted do not fit entirely in the main memory,
external sorting is required. An external sort requires the use of external
memory such as disks or tapes during sorting.
Merge Sort is an example of external sorting
3.
Insertion Sort
Insertion sort is a simple sorting algorithm that builds the final sorted array one
item at a time. It is much less efficient on large lists than more advanced algorithms
such as quicksort, heapsort, or merge sort. However, insertion sort provides several
advantages like simple implementation, efficient for (quite) small data sets,
more efficient in practice than most other simple quadratic algorithms, adaptive,
stable, in-place; i.e., only requires a constant amount of additional memory space,
online; i.e., can sort a list as it receives it
Output:
Bubble Sort
The simplest sorting algorithm is bubble sort. A bubble sort is an internal exchange
sort. This sorting technique is named bubble because of the logic is similar to the
bubble in water. When a bubble is formed, it is small at the bottom and when it
moves up it becomes bigger and bigger i.e. bubbles are in ascending order of their
size from the bottom to the top.
Output:
Selection Sort
Selection sort performs in-place comparison which means that the array is divided
into two parts, the sorted part at the left end and the unsorted part at the right
end. Initially, the sorted part is empty and the unsorted part is the entire list.
/*
* Main Function
*/
int main()
{
int array[10], i, size;
clrscr();
printf("How many numbers you want to sort: ");
scanf("%d", &size);
printf("\nEnter %d numbers\t", size);
printf("\n");
for (i = 0; i < size; i++)
scanf("%d", &array[i]);
selectionSort(array, size);
printf("\nSorted array after Selection sort is: ");
for (i = 0; i < size;i++)
printf(" %d ", array[i]);
getch();
}
Output:
Advantages
I. Insertion Sort- It is an in-place sorting algorithm so the space
requirement is minimal.
II. Bubble Sort- It is easy and simple to implement. Elements are swapped
in place without using additional storage, so the space requirement is at
minimum.
III. Selection Sort- It is simple and easy to implement. It gives 60%
performance improvement over bubble sort
Disadvantages
I. Insertion Sort- It is only useful when sorting a list of few items and is
inefficient for large lists.
II. Bubble Sort- It is slow as it takes O(n!) comparison to complete sorting.
III. Selection Sort- It performs poorly when dealing with large number of
elements.
Conclusion –
This microproject has demonstrated the many benefits of using sorting
algorithms for data structure. This microproject has demonstrated that sorting
algorithms are very useful and can significantly improve data sorting.
References –
1) https://www.sanfoundry.com/c-program-implement-selection-sort/
2) https://www.javatpoint.com/bubble-sort-program-in-c
3) https://www.geeksforgeeks.org/sorting-algorithms/