| 98 | } |
| 99 | |
| 100 | int main() |
| 101 | { |
| 102 | int a[] = { 5, 7, -8, 9, 10, 4, -7, 0, -12, 1, 6, 2, 3, -4, -15, 12 }; |
| 103 | int n = sizeof(a) / sizeof(a[0]); |
| 104 | |
| 105 | // get the maximum depth |
| 106 | int maxdepth = log(n) * 2; |
| 107 | |
| 108 | // sort the array using introsort the algorithm |
| 109 | introsort(a, a, a + n - 1, maxdepth); |
| 110 | |
| 111 | // print the sorted array |
| 112 | for (int i = 0; i < n; i++) { |
| 113 | cout << a[i] << " "; |
| 114 | } |
| 115 | |
| 116 | return 0; |
| 117 | } |
nothing calls this directly
no test coverage detected