OK */
| 1454 | |
| 1455 | /* OK */ |
| 1456 | void bsgs_introsort(struct bsgs_xvalue *arr,uint32_t depthLimit, int64_t n) { |
| 1457 | int64_t p; |
| 1458 | if(n > 1) { |
| 1459 | if(n <= 16) { |
| 1460 | bsgs_insertionsort(arr,n); |
| 1461 | } |
| 1462 | else { |
| 1463 | if(depthLimit == 0) { |
| 1464 | bsgs_myheapsort(arr,n); |
| 1465 | } |
| 1466 | else { |
| 1467 | p = bsgs_partition(arr,n); |
| 1468 | if(p > 0) bsgs_introsort(arr , depthLimit-1 , p); |
| 1469 | if(p < n) bsgs_introsort(&arr[p+1],depthLimit-1,n-(p+1)); |
| 1470 | } |
| 1471 | } |
| 1472 | } |
| 1473 | } |
| 1474 | |
| 1475 | /* OK */ |
| 1476 | void bsgs_insertionsort(struct bsgs_xvalue *arr, int64_t n) { |
no test coverage detected