DGIM改进型代码如下
#include "stdio.h"
#include "stdlib.h"
typedef struct
{
int size;
int time_stamp;
}BucketNode,*Bucket;
int count_bucket = 0;
void merge(Bucket buc,int n);
void estimate(Bucket buc,int count_window,int n);
void accurate(int *slip_window,int count_window);
int main()
{
int data; //接收数据流
int n = 1; //时间戳
int t; //需要输入的任意时刻
int i;
int fn = 2; //定义n的数目
int collect = 0; //统计小于n的1的个数
Bucket buc = (Bucket)malloc(50 * sizeof(BucketNode)); //桶_结构体指针数组
int count_window; //滑动窗口大小
int *slip_window; //滑动窗口数组
FILE *fp;
printf("请输入滑动窗口大小:\n");
scanf("%d",&count_window