summaryrefslogtreecommitdiff
path: root/include/spacesaving.h
blob: 5555f624448c9d25c5441374405af8c81d63da40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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<string ,int> Query(int k);
     //~spacesaving();







};



//#endif