Created
November 20, 2014 21:49
-
-
Save esse/1c90cbb3f3ad990491c9 to your computer and use it in GitHub Desktop.
maksimum_rec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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