#include <iostream>
#include <algorithm>
using namespace std;
void main()
{
int A[]={1,3,2,3,4,3,6,3};
int nSize=sizeof(A)/sizeof(int);
sort(A,A+nSize);
int * first=A;
int * last=NULL;
int find_value=A[0];
do
{
last=upper_bound(first, A+nSize, find_value);
cout<<"find_value "<<find_value<<"\t频度:"<<(float)(last-first)/nSize<<endl;
first=last;
if(first!=A+nSize)
find_value= * first;
}while(first!=A+nSize);
}
频度问题
最新推荐文章于 2022-08-14 18:36:22 发布