File tree Expand file tree Collapse file tree 22 files changed +82
-30
lines changed
src/main/java/eu/happycoders/sort Expand file tree Collapse file tree 22 files changed +82
-30
lines changed Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort ;
2
2
3
- import eu .happycoders .sort .method .*;
3
+ import eu .happycoders .sort .method .Counters ;
4
+ import eu .happycoders .sort .method .SortAlgorithm ;
4
5
import eu .happycoders .sort .utils .ArrayUtils ;
5
6
import java .util .Locale ;
6
7
import java .util .function .Function ;
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort ;
2
2
3
- import eu .happycoders .sort .method .*;
3
+ import eu .happycoders .sort .method .InsertionSort ;
4
+ import eu .happycoders .sort .method .JavaArraysSort ;
5
+ import eu .happycoders .sort .method .SelectionSort ;
6
+ import eu .happycoders .sort .method .SortAlgorithm ;
4
7
import eu .happycoders .sort .method .bubblesort .BubbleSortOpt1 ;
5
8
import eu .happycoders .sort .method .countingsort .CountingSort ;
6
9
import eu .happycoders .sort .method .heapsort .BottomUpHeapsort ;
7
10
import eu .happycoders .sort .method .heapsort .BottomUpHeapsortSlowComparisons ;
8
11
import eu .happycoders .sort .method .heapsort .Heapsort ;
9
12
import eu .happycoders .sort .method .heapsort .HeapsortSlowComparisons ;
10
13
import eu .happycoders .sort .method .mergesort .MergeSort ;
11
- import eu .happycoders .sort .method .quicksort .*;
14
+ import eu .happycoders .sort .method .quicksort .DualPivotQuicksort ;
15
+ import eu .happycoders .sort .method .quicksort .DualPivotQuicksortImproved ;
16
+ import eu .happycoders .sort .method .quicksort .PivotStrategy ;
17
+ import eu .happycoders .sort .method .quicksort .QuicksortImproved ;
18
+ import eu .happycoders .sort .method .quicksort .QuicksortVariant1 ;
12
19
import eu .happycoders .sort .utils .ArrayUtils ;
13
20
import eu .happycoders .sort .utils .Scorecard ;
14
21
import java .util .HashMap ;
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .comparisons ;
2
2
3
3
import eu .happycoders .sort .method .SortAlgorithm ;
4
- import eu .happycoders .sort .method .bubblesort .*;
4
+ import eu .happycoders .sort .method .bubblesort .BubbleSort ;
5
+ import eu .happycoders .sort .method .bubblesort .BubbleSortOpt1 ;
6
+ import eu .happycoders .sort .method .bubblesort .BubbleSortOpt2 ;
7
+ import eu .happycoders .sort .method .bubblesort .BubbleSortParallelDivideAndConquer ;
8
+ import eu .happycoders .sort .method .bubblesort .BubbleSortParallelOddEven ;
5
9
import java .util .List ;
6
10
7
11
/**
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .comparisons ;
2
2
3
3
import eu .happycoders .sort .method .SortAlgorithm ;
4
- import eu .happycoders .sort .method .quicksort .*;
5
4
import eu .happycoders .sort .method .quicksort .DualPivotQuicksort ;
6
- import java .util .*;
5
+ import eu .happycoders .sort .method .quicksort .DualPivotQuicksortImproved ;
6
+ import java .util .ArrayList ;
7
+ import java .util .List ;
7
8
8
9
/**
9
10
* Compares Dual-Pivot Quicksort with the improved version for various thresholds at which the
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .comparisons ;
2
2
3
3
import eu .happycoders .sort .method .SortAlgorithm ;
4
- import eu .happycoders .sort .method .quicksort .*;
5
- import java .util .*;
4
+ import eu .happycoders .sort .method .quicksort .PivotStrategy ;
5
+ import eu .happycoders .sort .method .quicksort .QuicksortImproved ;
6
+ import eu .happycoders .sort .method .quicksort .QuicksortVariant1 ;
7
+ import eu .happycoders .sort .method .quicksort .QuicksortVariant2 ;
8
+ import eu .happycoders .sort .method .quicksort .QuicksortVariant3 ;
9
+ import java .util .ArrayList ;
10
+ import java .util .List ;
6
11
7
12
/**
8
13
* Compares the regular Quicksort with the improved Quicksort for various thresholds at which the
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .comparisons ;
2
2
3
3
import eu .happycoders .sort .method .SortAlgorithm ;
4
- import eu .happycoders .sort .method .mergesort .*;
4
+ import eu .happycoders .sort .method .mergesort .MergeSort ;
5
+ import eu .happycoders .sort .method .mergesort .MergeSort2 ;
6
+ import eu .happycoders .sort .method .mergesort .MergeSort3 ;
5
7
6
8
/**
7
9
* Compares the three merge sort algorithms.
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .comparisons ;
2
2
3
3
import eu .happycoders .sort .method .SortAlgorithm ;
4
- import eu .happycoders .sort .method .quicksort .*;
5
- import java .util .*;
4
+ import eu .happycoders .sort .method .quicksort .PivotStrategy ;
5
+ import eu .happycoders .sort .method .quicksort .QuicksortSimple ;
6
+ import eu .happycoders .sort .method .quicksort .QuicksortVariant1 ;
7
+ import eu .happycoders .sort .method .quicksort .QuicksortVariant2 ;
8
+ import eu .happycoders .sort .method .quicksort .QuicksortVariant3 ;
9
+ import java .util .ArrayList ;
10
+ import java .util .List ;
6
11
7
12
/**
8
13
* Compares the various Quicksort algorithm variants.
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .comparisons ;
2
2
3
3
import eu .happycoders .sort .method .SortAlgorithm ;
4
- import eu .happycoders .sort .utils .*;
5
- import java .util .*;
4
+ import eu .happycoders .sort .utils .ArrayUtils ;
5
+ import eu .happycoders .sort .utils .Scorecard ;
6
+ import java .util .HashMap ;
7
+ import java .util .Locale ;
8
+ import java .util .Map ;
6
9
7
10
/**
8
11
* Base class to directly compare two or more sort algorithms.
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .method .bubblesort ;
2
2
3
- import eu .happycoders .sort .method .*;
3
+ import eu .happycoders .sort .method .Counters ;
4
+ import eu .happycoders .sort .method .SortAlgorithm ;
4
5
5
6
/**
6
7
* Bubble Sort implementation for performance tests.
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .method .bubblesort ;
2
2
3
- import eu .happycoders .sort .method .*;
3
+ import eu .happycoders .sort .method .Counters ;
4
+ import eu .happycoders .sort .method .SortAlgorithm ;
4
5
5
6
/**
6
7
* Bubble Sort implementation for performance tests.
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .method .bubblesort ;
2
2
3
- import eu .happycoders .sort .method .*;
3
+ import eu .happycoders .sort .method .Counters ;
4
+ import eu .happycoders .sort .method .SortAlgorithm ;
4
5
5
6
/**
6
7
* Bubble Sort implementation for performance tests.
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .method .bubblesort ;
2
2
3
- import eu .happycoders .sort .method .*;
3
+ import eu .happycoders .sort .method .Counters ;
4
+ import eu .happycoders .sort .method .SortAlgorithm ;
4
5
import java .util .concurrent .Phaser ;
5
6
import java .util .concurrent .atomic .AtomicInteger ;
6
7
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .method .mergesort ;
2
2
3
- import eu .happycoders .sort .method .*;
3
+ import eu .happycoders .sort .method .Counters ;
4
+ import eu .happycoders .sort .method .SortAlgorithm ;
4
5
5
6
/**
6
7
* Merge sort implementation for performance tests.
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .method .mergesort ;
2
2
3
- import eu .happycoders .sort .method .*;
3
+ import eu .happycoders .sort .method .Counters ;
4
+ import eu .happycoders .sort .method .SortAlgorithm ;
4
5
import java .util .Arrays ;
5
6
6
7
/**
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .method .quicksort ;
2
2
3
- import eu .happycoders .sort .method .*;
3
+ import eu .happycoders .sort .method .Counters ;
4
+ import eu .happycoders .sort .method .SortAlgorithm ;
4
5
import eu .happycoders .sort .utils .ArrayUtils ;
5
6
6
7
/**
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .method .quicksort ;
2
2
3
- import eu .happycoders .sort .method .*;
3
+ import eu .happycoders .sort .method .Counters ;
4
+ import eu .happycoders .sort .method .InsertionSort ;
5
+ import eu .happycoders .sort .method .SortAlgorithm ;
4
6
import eu .happycoders .sort .method .quicksort .DualPivotQuicksort .PivotStrategy ;
5
7
6
8
/**
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .method .quicksort ;
2
2
3
- import eu .happycoders .sort .method .*;
3
+ import eu .happycoders .sort .method .Counters ;
4
+ import eu .happycoders .sort .method .InsertionSort ;
5
+ import eu .happycoders .sort .method .PartitioningAlgorithm ;
6
+ import eu .happycoders .sort .method .SortAlgorithm ;
4
7
5
8
/**
6
9
* Quicksort combined with Insertion Sort for small arrays.
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .method .quicksort ;
2
2
3
- import eu .happycoders .sort .method .*;
3
+ import eu .happycoders .sort .method .Counters ;
4
+ import eu .happycoders .sort .method .PartitioningAlgorithm ;
5
+ import eu .happycoders .sort .method .SortAlgorithm ;
4
6
import eu .happycoders .sort .utils .ArrayUtils ;
5
7
6
8
/**
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .method .quicksort ;
2
2
3
- import eu .happycoders .sort .method .*;
3
+ import eu .happycoders .sort .method .Counters ;
4
+ import eu .happycoders .sort .method .PartitioningAlgorithm ;
5
+ import eu .happycoders .sort .method .SortAlgorithm ;
4
6
import eu .happycoders .sort .utils .ArrayUtils ;
5
7
6
8
/**
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .method .quicksort ;
2
2
3
- import eu .happycoders .sort .method .*;
3
+ import eu .happycoders .sort .method .Counters ;
4
+ import eu .happycoders .sort .method .PartitioningAlgorithm ;
5
+ import eu .happycoders .sort .method .SortAlgorithm ;
4
6
import eu .happycoders .sort .utils .ArrayUtils ;
5
7
6
8
/**
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .pivot ;
2
2
3
- import eu .happycoders .sort .method .*;
4
- import eu .happycoders .sort .method .quicksort .*;
5
- import eu .happycoders .sort .utils .*;
6
- import java .util .*;
3
+ import eu .happycoders .sort .method .PartitioningAlgorithm ;
4
+ import eu .happycoders .sort .method .SortAlgorithm ;
5
+ import eu .happycoders .sort .method .quicksort .PivotStrategy ;
6
+ import eu .happycoders .sort .method .quicksort .QuicksortVariant1 ;
7
+ import eu .happycoders .sort .utils .ArrayUtils ;
8
+ import eu .happycoders .sort .utils .Scorecard ;
9
+ import java .util .HashMap ;
10
+ import java .util .Locale ;
11
+ import java .util .Map ;
7
12
import java .util .concurrent .ThreadLocalRandom ;
8
13
9
14
/**
Original file line number Diff line number Diff line change 1
1
package eu .happycoders .sort .utils ;
2
2
3
3
import eu .happycoders .sort .method .SortAlgorithm ;
4
- import java .util .*;
4
+ import java .util .ArrayList ;
5
+ import java .util .Locale ;
5
6
6
7
/**
7
8
* A scorecard to print the fastest and median times measured for a specific sort algorithm and
You can’t perform that action at this time.
0 commit comments