cutshort

14
CutShort A Hybrid Sorting Technique BY: Ashish Garg Versha Garg Sudhir Goswami

Upload: ashish-garg

Post on 20-Feb-2017

18 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CutShort

CutShort A Hybrid Sorting Technique

BY:Ashish Garg

Versha Garg Sudhir Goswami

Page 2: CutShort

What is a Sorting technique ?

Sorting is a process that organizes a collection of data into either ascending or descending order.

Some sorting algorithms Insertion Sort Merge Sort Quick Sort

Page 3: CutShort

Importance of Sorting

Data searching can be optimized to a very high level if data is sorted.

Sorting is also done to represent data in more readable formats.

Used in other important algorithms.

Page 4: CutShort

Motive

Dividing an input array into a number of sub-arrays so as to reduce the length of the array for performing sorting on individual sub-array.

6512 45 451 12 15 54 3 502 1 335 2 5795

1 2 3 12 15 54 45 502 451 335 6512 5795

Page 5: CutShort

Getting the counts of numbers requiring the same number of bits (BitCount) in its binary form

Arranging the numbers such that numbers with same BitCount belong a same sub-arrays

Sorting the sub-arrays with pre-existing sorting technique

Process

Page 6: CutShort

Number Binary Representation No. of bits required

12 1010 4

53 110101 6

500 111110100 9

9999 10011100001111 14

BitCounts

Page 7: CutShort

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14

6512 45 451 12 15 54 3 502 1 335 2 5795

0 1 2 0 2 0 2 0 0 3 0 0 0 2 0

BitBand

Finding BitCount

Array “ BitBand ” : Each element represents the counts of numbers with same BitCount

Page 8: CutShort

6512 45 451 12 15 54 3 502 1 335 2 5795

1 3 2 12 15 54 45 451 502 335 6512 5795

Arranging the elements

Page 9: CutShort

Sorting sub-arrays

1 3 2 12 15 54 45 451 502 335 6512 5795

1 2 3 12 15 45 54 335 451 502 5795 6512

Page 10: CutShort

Complexity

Factor ‘ d ’ is the number of sub-array after performing the CutShort pre-processing step.

Best case: T(n) = O( n.log (n / dmax ))

Average Case: T(n) = O( n.log n/d )

Worst case: T(n) = O( n.log n )

Page 11: CutShort

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 210

0.01

0.02

0.03

0.04

0.05

0.06

0.07

Time Complexity Comparsion with QuickSort

QuickSort QuickSort + CutShort

Page 12: CutShort

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 210

0.01

0.02

0.03

0.04

0.05

0.06

0.07

Time Complexity Comparsion with MergeSort

MergeSort Merge + Cutshort

Page 13: CutShort

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 210

2

4

6

8

10

12

14

Time Complexity Comparsion with Insertion Sort

Insertion Sort Insertion + Cutshort

Page 14: CutShort

Thank You