A Novel Sorting Technique To Sort Elemen PDF
A Novel Sorting Technique To Sort Elemen PDF
A Novel Sorting Technique To Sort Elemen PDF
I. INTRODUCTION
Sorting is the most fundamental algorithmic problem in
computer science and a rich source of programming
problems for two distinct reasons. First, sorting is a useful
operation which efficiently solves many tasks that every
programmer encounters. As soon as you recognize your job
is a special case of sorting, proper use of library routines
make short work of the problem. Second, literally dozens of
different sorting algorithms have been developed, each of
which rests on a particular clever idea or observation. Most
algorithm design paradigms lead to interesting sorting
algorithms, including divide-and-conquer, randomization,
incremental insertion, and advanced data structures. Many
interesting programming/mathematical problems follow
from properties of these algorithms. Sorting is an efficient
technique which performs the task to arrange the elements in
ascending or descending order. Sorting technique is
generally used in our day to day life as well as in many
computer applications.
E.g.- A teacher keeps the answer book of the students in
sorted order by applying sorting technique on roll no.
Suppose, we may regard a telephone directory as a list, each
record having three fields: name, address, and phone
number. We may wish to locate the record corresponding to
a given number, in which case the phone number field
would be key. One of the sorting technique is helpful in
order to locate the record by using key. In a database,
sorting technique sometimes used to arrange the records by
considering one field of the record. Typically, sorting
technique arranges the element from highest to lowest or
lowest to highest.
Manuscript received October, 2013.
Prof. Debabrata Swain, received his B.Tech in Computer Science and
Engineering from RIT, Berhampur, India
Prof G.Ramakrishna, received his B.Tech in Computer Science and
Engineering from RNEC Ongole, Affliated to JNTU, Hyderabad,India,
Prof Hitesh Mohapatra, received his B.Tech in Information
Technology from GIET, Gunupur, BPUT,India
Prof Pramoda Patro, received his M.Sc in Mathematics from
Khallikote Autonomous College, Berhampur, India
Prof. P. M. Dhanrao has completed B.E. (Computer) From University
of Pune, India.
212
8 34 64 51 32 21
After p = 4
8 34 51 64 32 21
After p = 5
8 32 34 51 64 21
After p = 6
8 21 32 34 51 64
213
Example
Original
34 8 64 51 32 21
Moved
After p=1 8 34 64 51 32 21
1
After p=2 8 34 64 51 32 21
0
After p=3 8 34 51 64 32 21
1
After p=4 8 32 34 51 64 21
3
After p=5 8 21 32 34 51 64
4
2.4 Quick Sort
Another divide-and-conquer sorting algorithm. To
understand quick-sort, lets look at a high-level description
of the algorithm
1) Divide
If the sequence S has 2 or more elements, select an element
x from S to be your pivot. Any arbitrary element, like the
last, will do. Remove all the elements of S and divide them
into 3 sequences:
L, holds Ss elements less than x
E, holds Ss elements equal to x
G, holds Ss elements greater than x
2)Recurs
Recursively sort L and G
3)Conquer
Finally, to put elements back into S in order, first inserts the
elements of L, then those of E, and those of G.
V. CONCLUSION
Here we have shown our algorithm by using which we can
sort the different array elements in Ascending order. Our
algorithm is only working for unique elements. Here we
have also shown how memory is properly utilized in our
policy using dynamic memory allocation. By using this we
have released the unused memory after arranging the
elements in sorted order.
arr[10-1]=10
arr[9]=10
VII. ACKNOWLEDGEMENT
[9]
[10]
[11]
[12]
[13]
[14]
[15]
[16]
[17]
http://en.wikipedia.org/wiki/Sorting_algorithm
http://en.wikipedia.org/wiki/Selection_sort
http://en.wikipedia.org/wiki/Bubble_sort
http://en.wikipedia.org/wiki/Insertion_sort
http://en.wikipedia.org/wiki/Selection_sort
http://en.wikipedia.org/wiki/Quicksort
http://en.wikipedia.org/wiki/Merge_sort
http://www.cs.manchester.ac.uk/ugt/COMP26912/lecture/lecturesorting.pdf
http://www.cs.ucf.edu/courses/cop3502/nihan/spr03/sort.pdf
Introduction to Algorithms by Thomas H. Cormen, Charles E.
Leiserson, Ronald L. Rivest, fifth Indian printing (Prentice Hall of
India private limited), New Delhi-110001
Computer Algorithms by Ellis Horowitz, Sartaj Sahni, Sanguthevar
Rajasekaran, Galgotia publications,5 Ansari road, Daryaganj, New
Delhi-110002
C.A.R. Hoare, Quick sort, Computer Journal, Vol. 5, 1, 10-15 (1962)
P. Hennequin, Combinatorial analysis of Quick-sort algorithm,
RAIRO: Theoretical Informatics and Applications, 23 (1988), pp.
317333
Lecture Notes on Design & Analysis of Algorithms G P Raja Sekhar
Department of Mathematics I I T Kharagpur
Knuth D. (1997) The Art of Computer Programming, Volume 3:
Sorting and Searching, Third Edition. AddisonWesley, 1997. ISBN
0-201-89685-0. pp. 138141, of Section 5.2.3: Sorting by Selection
Let Us C by Yashvant Kanethkar, 8th edition (BPB publications).b14 Connaught place, New Delhi-110001
MERRITT S. M. (1985), An inverted taxonomy of Sorting
Algorithms. Programming Techniques and Data Structures,
Communications of ACM, Vol. 28, Number 1, ACM
215
216