-
-
Save pyk/ff249882f0b5d15cea29 to your computer and use it in GitHub Desktop.
Exercise 1.2-2 & 1.2-3 on Introduction to Algorithm book by Cormen et al.
This file contains hidden or 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> | |
#include <math.h> | |
int | |
main() | |
{ | |
int n; | |
for(n = 1; n < 10000; n++) { | |
if((8*pow(n,2)) < (64*n*log(n))) { | |
printf("1.2-2 terakhir n = %d\n", n); | |
break; | |
} | |
} | |
for(n = 1; n < 10000; n++) { | |
if((100*pow(n,2)) < (pow(2,n))) { | |
printf("1.2-3 terakhir n = %d\n", n); | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment