33 lines
952 B
Plaintext
33 lines
952 B
Plaintext
Sorting generic algorithms examples
|
|
Sort algorithms
|
|
4 4 10 13 37 50 51 56 63 67 76 79 85 87 89
|
|
81 79 75 64 61 61 57 56 39 39 35 30 18 13 7
|
|
89 87 85 79 76 67 63 56 51 50 37 13 10 4 4
|
|
Partial sort examples
|
|
42 97 8 74 94 98 92 36 7 97 87 85 1 24 67
|
|
1 7 8 24 36 42 67 98 97 97 94 92 87 85 74
|
|
59 9 1 49 84 20 34 98 87 30 71 69 30 15 23
|
|
98 87 84 71 69 59 49
|
|
Nth largest example
|
|
fifth largest is 56 in
|
|
19 27 27 43 56 70 94 75 95 82
|
|
Binary search example
|
|
1 6 8 10 31 45 45 58 69 70 75 85 86 94 95
|
|
does not contain an 11
|
|
1 6 8 10 11 14 31 45 45 58 69 70 75 85 86 94 95
|
|
Merge algorithm examples
|
|
7 8 17 36 36 43 50 52 54 60 64 68 72 75 76 81 83 90 94 98
|
|
Set operations:
|
|
1 2 3 4 5 6 7
|
|
1 2 3 3 4 4 5 5 6 7
|
|
3 4 5
|
|
1 2
|
|
1 2 6 7
|
|
set is not subset
|
|
93 86 87 85 78 80 84 83 74 1 19 32 43 9 8
|
|
Largest value 93
|
|
87 86 84 85 78 80 9 83 74 1 19 32 43 8
|
|
97 86 87 85 78 80 84 83 74 1 19 32 43 8 9
|
|
1 8 9 19 32 43 74 78 80 83 84 85 86 87 97
|
|
End sorting examples
|