From 6a681ec7080bbeab9770218446ccb0842c22d92e Mon Sep 17 00:00:00 2001 From: zhang zhihao Date: Sun, 13 Nov 2022 10:57:15 +0000 Subject: [PATCH] Upload New File --- include/LossyCounting.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 include/LossyCounting.h diff --git a/include/LossyCounting.h b/include/LossyCounting.h new file mode 100644 index 0000000..0ae459b --- /dev/null +++ b/include/LossyCounting.h @@ -0,0 +1,31 @@ +#pragma once +//#ifndef _LossyCounting_H +//#define _LossyCounting_H +#include "../init/params.h" + +#define rep(i,a,n) for(int i=a;i<=n;i++) +using namespace std; + +class LossyCounting +{ + private: + ssummary *ss; + int K; + public: + LossyCounting(int K); + void Insert(string x,int c); + void clear(int c); + struct Node {string x; int y;} q[MAX_MEM+10]; + static int cmp(Node i,Node j) {return i.y>j.y;} + void work(); + pair Query(int k); + //~LossyCounting(); + + +}; + + + + + +//#endif \ No newline at end of file