Skip to content

Instantly share code, notes, and snippets.

@esse
Created November 20, 2014 21:49
Show Gist options
  • Save esse/1c90cbb3f3ad990491c9 to your computer and use it in GitHub Desktop.
Save esse/1c90cbb3f3ad990491c9 to your computer and use it in GitHub Desktop.
maksimum_rec
#include <stdio.h>
int* maksimum ( int N, int *t ) {
if ( N == 0 )
return t + 0;
int* rec_maks = maksimum ( N - 1, t );
if ( *( t + N ) > *rec_maks ) {
return t + N;
}
return rec_maks;
}
void main() {
int t[] = {1,2,3,-1,4,2,6,8};
printf("%d", *maksimum(8,t));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment