Government Polytechnic ,Washim
A
MICRO PROJECT REPORT
ON
“ QUICK SORT USING C ON LINUX PLATFORM ”
OF
Subject: Operating System (22516)
Submitted By
Name Roll no Enroll No
Vedant Santosh Pingalkar 30 2000310244
Subject Teacher H.O.D.
Mr. S. S. Gharde Mr. U. A. Bagade
Lecturer in Info. Tech. Department Information Technology Department
Principal
Dr. G. B. Gawalwad
Government Polytechnic, Washim
DEPARTMENT OF INFORMATION TECHNOLOGY
Term I 2022-2023
Government Polytechnic,Washim
CERTIFICATE
This is to certify that :
Tanmay Anant Patil
Third year Student of Information Technology has submitted a MICRO PROJECT report on
“QUICK SORT USING C ON LINUX PLATFORM ”
During the academic session 2022-2023 in a satisfactory manner in the partial full fill meant for
the requirement of Subject: Operating System
Sub code (22516)
for the Diploma in “Information Technology ”
awarded by
Maharashtra State Board of Technical Education, Mumbai.
Subject Teacher H.O.D.
Mr. S.S. Gharade Mr. U. A. Bagade
Lecturer in Info. Tech. Department Information Technology
Principal
Dr. B. G. Gawalwad
Government Polytechnic, Washim
DEPARTMENT OF INFORMATION TECHNOLOGY
Term I 2022-23
Page 2 of 15
ACKNOWLEDGEMENT
We would like to express my gratitude to all the people behind the screen who
helped me to transform an idea into a real application. We profoundly thank
Prof.Dr. B.G.Gawalwad principal of our institute who has been an excellent guide
and also a great source of inspiration to our work. We would like to thank our
Professors of Information technology branch for his technical guidance, constant
encouragement and support in carrying out my project at college.
The satisfaction and euphoria that accompany the successful completion of the task
would be great but incomplete without the mention of the people who made it
possible with their constant guidance and encouragement crowns all the efforts
with success. In this context, We would like thank all the other staff members, both
teaching and non-teaching, who have extended their timely help and eased our
task. Last, but not least, we would like to thank the authors of various research
articles and books that were referred to. …
Page 3 of 15
ABSTRACT
Quick Sort Using c On Linux Platform can be consider as a most important
thing in economic world.in the present scenario the banking sector is the common
need in everyday life.in day to day life we face the problems and then we realize
something is not done in this sector like we want to change the location (branch) of
our account then we need to fill the application and then some day waiting to
complete bank process.
In this process amount of time is more as well as here occur manual work which
is increases man power. Also in current scenario aadhar card linking is must with
bank account and it is possible through the A but if in urgent we want to link
aadhar it may be not possible there is no are available in that case we provide this
facility throught our project
Page 4 of 15
INDEX
Sr.No Content Page.No
1 Introduction 6
2 Information Of Ubuntu 7
3 Advantages And Disadvantages of 8
Operating System
4 Quick Sort Pivot Algorithm And 9-10
Quick Sort Pivot Pseudocode
5 Quick Sort Algorithm And Quick Sort 11
Pseudocode
6 Code for Quick Sort Program 12-13
7 Output 14
8 Conclusion & References 15
Page 5 of 15
INTRODUCTION
An operating system (OS) is the software component of a computer system
that is responsible for the management and coordination of activities and the
sharing of the resources of the computer. The OS acts as a host for application
programs that are run on the machine. As a host, one of the purposes of an OS is to
handle the details of the operation of the hardware. This relieves application
programs from having to manage these details and makes it easier to write
applications. Almost all computers use an OS of some type.
OS’s offer a number of services to application programs and users. Applications
access these services through application programming interfaces (APIs) or system
calls. By using these interfaces, the application can request a service from the OS,
pass parameters, and receive the results of the operation. Users may also interact
with the OS by typing commands or using a graphical user interface (GUI)
Page 6 of 15
Information Of Ubuntu
Ubuntu is a Linux distribution based on Debian mostly composed of free and
open-source software. Ubuntu is officially released in three editions are Desktop,
Server and Core for Internet of things devices and robots. All the editions can run
on the computer alone, or in a virtual machine Ubuntu is a popular operating
system for cloud computing, with support for Open Stack. Ubuntu’s default
desktop as of version 17.10, is GNOME. Ubuntu is released every six months, with
long-term support (LTS) releases every two years as of 23 April 2020, the latest
release and also the most recent long-term support release is 20.04 "Focal Fossa",
which is supported until 2025 under public support and until 2030 as a paid option.
The next release is due sometimes in October 2020, and will most likely be titled
20.10.
Ubuntu is developed by Canonical and a community of other developers, under a
meritocratic governance model Canonical provider security updates and support
for each Ubuntu release, starting from the release date and until the release reaches
its designated end-of-life (EOL) date Canonical generates revenue through the sale
of premium services related to Ubuntu.
Page 7 of 15
Advantages of Operating System
• Allows you to hide details of hardware by creating an abstraction hich a user
may execute programs/applications
• Offers an environment in which a user may execute programs/applications
• Easy to use with a GUI
• The operating system must make sure that the computer system convenient to use
• Operating System acts as an intermediary among applications and the hardware
components
• It provides the computer system resources with easy to use format
Disadvantages of Operating System
• If any issue occurs in OS, you may lose all the contents which have been stored
in your system
• Operating system's software is quite expensive for small size organization which
adds burden on them. Example Windows
• It is never entirely secure as a threat can occur at any time
Page 8 of 15
Quick Sort Pivot Algorithm :-
Step 1 − Choose the highest index value has pivot
Step 2 − Take two variables to point left and right of the list
excluding pivot
Step 3 − left points to the low index
Step 4 − right points to the high
Step 5 − while value at left is less than pivot move right
Step 6 − while value at right is greater than pivot move left
Step 7 − if both step 5 and step 6 does not match swap left and right
Step 8 − if left ≥ right, the point where they met is new
Quick Sort Pivot Pseudocode :-
function partitionFunc (left, right, pivot)
left Pointer = left
right Pointer = right - 1
while True do
while A[++left Pointer] < pivot do
//do-nothing
end while
while rightPointer > 0 && A[--right Pointer] > pivot do
Page 9 of 15
//do-nothing end while
if leftPointer >= rightPointer
break
else swap leftPointer, rightPointer
end if
end while
swap leftPointer, right
return leftPointer
end function
Page 10 of 15
Quick Sort Algorithm :-
Step 1 − Make the right-most index value pivot
Step 2 − partition the array using pivot value
Step 3 − quicksort left partition recursively
Step 4 − quicksort right partition recursively
Quick Sort Pseudocode :-
procedure quicksort (left, right)
if right-left <= 0
return
else
pivot = A[right] partition = partitionFunc (left, right, pivot)
quicksort (left, partition-1)
quicksort(partition+1,right)
end if
end procedure
Code for Quick Sort Program :-
#!/bin/bash
function quicksort() {
left=$1
right=$2
Page 11 of 15
if [[ $1 -lt $2 ]]
then
pivot=${array[$1]}
while(( $left < $right ))
do
while((${array[$left]} <= $pivot && $left < $2))
do
left=$(($left + 1))
done
while((${array[$right]} > $pivot))
do
right=$(($right-1))
done
if [[ $left -lt $right ]]
then
temp=${array[$left]}
array[$left]=${array[$right]}
array[$right]=$temp
fi
done
temp=${array[$right]}
array[$right]=${array[$1]}
array[$1]=$temp
Page 12 of 15
temp=$right
# pivot used in each case are printed for evaluation
quicksort $1 $((right-1)) array
quicksort $((temp+1)) $2 array
fi }
echo “Enter the number of elements “
read limit
echo “Enter the elements into the list”
for((i=0;i <$limit;i++))
do
read array[i]
done
quicksort 0 $((limit-1)) array
echo Array elements after are :
for((i=0;i <limit;i++))
do
echo${array[$i]}
done
Page 13 of 15
Output :-
Page 14 of 15
Conclusion :-
In this project we have studied how to create a quicksort
program using shell script. Also we studied about the shell
script in Ubuntu Operating System. An operating system is a
software which acts as an interface between the end user
and computer hardware.
References :-
• https://en.wikipedia.org/wiki/Operating_system
• https://en.wikipedia.org/wiki/Shell_script
Page 15 of 15