#include <stdio.h>
#include <string.h>
typedef unsigned long long ull_typed;
ull_typed tree_pop_min(ull_typed i, ull_typed j) {
return i+j+1;
}
ull_typed tree_pop_max(ull_typed i) {
return 2*i+1;
}
char *back_prs(char *s, char c) {
int i=strlen(s)-1;
while(i>=0 && *(s+i)!=c)
--i;
return s+i+1;
}
void doc(char *a) { printf(">>>\t%s\n", a); printf("source file:\t\'%s\'\n", FILE); printf("compiled on:\t%s\t%s\n", TIME, DATE); }
int main(int argc, char **argv)
{
const int b=128;
int c=0;
ull_typed i=0, j=0, k, l=0, m=0, n=0;
while(c<b) {
k=tree_pop_min(i, j);
l=tree_pop_max(l);
printf("min(%d):\t%llu\n", c, k);
printf("max(%d):\t%llu\n", c, l);
if(j)
printf(
"\ttree(%d)/tree(%d):\t%.15lf\n", c, c-1,
(double)k/(double)j
);
else
printf("\tdenominator vanished\n");
if(l)
printf(
"\tmin(%d)/max(%d):\t%.15lf\n", c, c,
(double)k/(double)l
);
else
printf("\tdenominator vanished\n");
printf("\tmin(%d)-min(%d):\t%llu\n", c, c-1, k-m);
printf("\tmax(%d)-max(%d):\t%llu\n", c, c-1, l-n);
i=j;
j=k;
m=k;
n=l;
++c;
return 0;
}