From ef8f3c811f7c82a1a3731d1e21866eb6d0da05f8 Mon Sep 17 00:00:00 2001 From: zhang zhihao Date: Sun, 13 Nov 2022 10:57:25 +0000 Subject: [PATCH] Upload New File --- include/spacesaving.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/spacesaving.h diff --git a/include/spacesaving.h b/include/spacesaving.h new file mode 100644 index 0000000..5555f62 --- /dev/null +++ b/include/spacesaving.h @@ -0,0 +1,32 @@ +#pragma once +//#ifndef _spacesaving_H +//#define _spacesaving_H + +#include "../init/params.h" +#define rep(i,a,n) for(int i=a;i<=n;i++) +using namespace std; +class spacesaving +{ + private: + ssummary *ss; + int K,M2; + public: + spacesaving(int M2,int K); + void Insert(string x); + 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); + //~spacesaving(); + + + + + + + +}; + + + +//#endif \ No newline at end of file