Skip to content

Instantly share code, notes, and snippets.

@purplejacket
Created June 14, 2023 03:44
Show Gist options
  • Save purplejacket/4f5678f985e8a1154b3e9e3116ce6a64 to your computer and use it in GitHub Desktop.
Save purplejacket/4f5678f985e8a1154b3e9e3116ce6a64 to your computer and use it in GitHub Desktop.
sort2.c — see for example "Faster sorting algorithms discovered using deep reinforcement learning" — https://www.nature.com/articles/s41586-023-06004-9
void variable_sort_2(int length, int *a) {
if(length == 2){
if(a[0] > a[1]){
int temp = a[0];
a[0] = a[1];
a[1] = temp;
}
}
}
static int a0[] = {};
int main(void){
variable_sort_2(0, a0);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment