Code



Application output:

testing 'partition5a' Code: comparisons = 63, swaps = 107, total = 170 With all orderings of distinct elements: 0 swaps: 4 instances 1 swaps: 32 instances 2 swaps: 68 instances 3 swaps: 16 instances Average number of swaps: 1.8 With all orderings of potentially nondistinct elements: Error, not idempotent: [0, 0, 0, 0, 0] => [0, 0, 0, 0, 0] testing 'partition5b' Code: comparisons = 17, swaps = 21, total = 38 With all orderings of distinct elements: 0 swaps: 4 instances 1 swaps: 20 instances 2 swaps: 42 instances 3 swaps: 40 instances 4 swaps: 14 instances Average number of swaps: 2.33333 With all orderings of potentially nondistinct elements: 0 swaps: 36 instances 1 swaps: 122 instances 2 swaps: 200 instances 3 swaps: 146 instances 4 swaps: 37 instances Average number of swaps: 2.04806 testing 'partition5c' Code: comparisons = 10, swaps = 12, total = 22 With all orderings of distinct elements: 0 swaps: 4 instances 1 swaps: 14 instances 2 swaps: 25 instances 3 swaps: 30 instances 4 swaps: 26 instances 5 swaps: 16 instances 6 swaps: 5 instances Average number of swaps: 3.06667 With all orderings of potentially nondistinct elements: 0 swaps: 36 instances 1 swaps: 92 instances 2 swaps: 130 instances 3 swaps: 138 instances 4 swaps: 92 instances 5 swaps: 42 instances 6 swaps: 11 instances Average number of swaps: 2.60628 testing 'partition5d' Code: comparisons = 7, swaps = 8, total = 15 With all orderings of distinct elements: 0 swaps: 4 instances 1 swaps: 14 instances 2 swaps: 24 instances 3 swaps: 29 instances 4 swaps: 26 instances 5 swaps: 16 instances 6 swaps: 6 instances 7 swaps: 1 instances Average number of swaps: 3.13333 With all orderings of potentially nondistinct elements: 0 swaps: 36 instances 1 swaps: 100 instances 2 swaps: 128 instances 3 swaps: 133 instances 4 swaps: 94 instances 5 swaps: 39 instances 6 swaps: 10 instances 7 swaps: 1 instances Average number of swaps: 2.57486 testing 'partition5e' Code: comparisons = 6, swaps = 8, total = 14 With all orderings of distinct elements: 0 swaps: 4 instances 1 swaps: 12 instances 2 swaps: 19 instances 3 swaps: 25 instances 4 swaps: 25 instances 5 swaps: 18 instances 6 swaps: 11 instances 7 swaps: 5 instances 8 swaps: 1 instances Average number of swaps: 3.53333 With all orderings of potentially nondistinct elements: 0 swaps: 36 instances 1 swaps: 88 instances 2 swaps: 100 instances 3 swaps: 123 instances 4 swaps: 106 instances 5 swaps: 53 instances 6 swaps: 25 instances 7 swaps: 9 instances 8 swaps: 1 instances Average number of swaps: 2.89649

Paste info


Author: Guest
Views: 337
Private: no
Expires: Never
Uploaded: 06.02.16 19:31
Votes: 0

Compilation


Compiler: DMD 2.076.1 ( 2.076.1 )
Pointer size: m64

Actions