MCPcopy Create free account
hub / github.com/albertobsd/keyhunt / bsgs_insertionsort

Function bsgs_insertionsort

bsgsd.cpp:1476–1489  ·  view source on GitHub ↗

OK */

Source from the content-addressed store, hash-verified

1474
1475/* OK */
1476void bsgs_insertionsort(struct bsgs_xvalue *arr, int64_t n) {
1477 int64_t j;
1478 int64_t i;
1479 struct bsgs_xvalue key;
1480 for(i = 1; i < n ; i++ ) {
1481 key = arr[i];
1482 j= i-1;
1483 while(j >= 0 && memcmp(arr[j].value,key.value,BSGS_XVALUE_RAM) > 0) {
1484 arr[j+1] = arr[j];
1485 j--;
1486 }
1487 arr[j+1] = key;
1488 }
1489}
1490
1491int64_t bsgs_partition(struct bsgs_xvalue *arr, int64_t n) {
1492 struct bsgs_xvalue pivot;

Callers 1

bsgs_introsortFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected