Compare sorting algorithms' performance: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: changed font-size for output.) |
m (added sorting category.) |
||
Line 1: | Line 1: | ||
{{task|Sorting}} |
{{task|Sorting Algorithms}} |
||
[[Category:Sorting]] |
|||
{{Sorting Algorithm}} |
|||
Measure a relative performance of sorting algorithms implementations. |
Measure a relative performance of sorting algorithms implementations. |
||
Line 5: | Line 8: | ||
Consider three type of input sequences: |
Consider three type of input sequences: |
||
* ones: sequence of all ''1'''s. Example: {1, 1, 1, 1, 1} |
:* ones: sequence of all ''1'''s. Example: {1, 1, 1, 1, 1} |
||
* range: ascending sequence, i.e. already sorted. Example: {1, 2, 3, 10, 15} |
:* range: ascending sequence, i.e. already sorted. Example: {1, 2, 3, 10, 15} |
||
* shuffled range: sequence with elements randomly distributed. Example: {5, 3, 9, 6, 8} |
:* shuffled range: sequence with elements randomly distributed. Example: {5, 3, 9, 6, 8} |
||
Consider at least two different sorting functions (different algorithms or/and different implementation of the same algorithm). |
Consider at least two different sorting functions (different algorithms or/and different implementation of the same algorithm). |
||
For example, consider [[Bubble Sort]], [[Insertion sort]], [[Quicksort]] or/and implementations of Quicksort with different pivot selection mechanisms. Where possible, use existing implementations. |
For example, consider [[Bubble Sort]], [[Insertion sort]], [[Quicksort]] or/and implementations of Quicksort with different pivot selection mechanisms. Where possible, use existing implementations. |
||
Preliminary subtask: |
Preliminary subtask: |
||
* [[Bubble Sort]], [[Insertion sort]], [[Quicksort]], [[Radix sort]], [[Shell sort]] |
:* [[Bubble Sort]], [[Insertion sort]], [[Quicksort]], [[Radix sort]], [[Shell sort]] |
||
* [[Query Performance]] |
:* [[Query Performance]] |
||
* [[Write float arrays to a text file]] |
:* [[Write float arrays to a text file]] |
||
* [[Plot x, y arrays]] |
:* [[Plot x, y arrays]] |
||
* [[Polynomial Fitting]] |
:* [[Polynomial Fitting]] |
||
General steps: |
General steps: |
||
# Define sorting routines to be considered. |
:# Define sorting routines to be considered. |
||
# Define appropriate sequence generators and write timings. |
:# Define appropriate sequence generators and write timings. |
||
# Plot timings. |
:# Plot timings. |
||
# What conclusions about relative performance of the sorting routines could be made based on the plots? |
:# What conclusions about relative performance of the sorting routines could be made based on the plots? |
||
<br><br> |
|||
=={{header|AutoHotkey}}== |
=={{header|AutoHotkey}}== |