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

Function bsgs_insertionsort

keyhunt.cpp:3676–3689  ·  view source on GitHub ↗

OK */

Source from the content-addressed store, hash-verified

3674
3675/* OK */
3676void bsgs_insertionsort(struct bsgs_xvalue *arr, int64_t n) {
3677 int64_t j;
3678 int64_t i;
3679 struct bsgs_xvalue key;
3680 for(i = 1; i < n ; i++ ) {
3681 key = arr[i];
3682 j= i-1;
3683 while(j >= 0 && memcmp(arr[j].value,key.value,BSGS_XVALUE_RAM) > 0) {
3684 arr[j+1] = arr[j];
3685 j--;
3686 }
3687 arr[j+1] = key;
3688 }
3689}
3690
3691int64_t bsgs_partition(struct bsgs_xvalue *arr, int64_t n) {
3692 struct bsgs_xvalue pivot;

Callers 1

bsgs_introsortFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected