-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsets.h
43 lines (39 loc) · 1022 Bytes
/
sets.h
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
33
34
35
36
37
38
39
40
41
42
43
#ifndef UNIQUE_SETS_H
#define UNIQUE_SETS_H
#include <iostream>
#include <set>
#include <locale>
#include <algorithm>
#include <iterator>
#include <vector>
#include <sstream>
#include <fstream>
#include <stdio.h>
#include <string.h>
#include <map>
#include "radix.h"
#include "tree.h"
class UniqueSets
{
public:
UniqueSets();
~UniqueSets();
// Implementation of item 1-a
bool add_set(string line);
// Implementation of item 1-b
void get_n_duplicates(unsigned int& duplicates, unsigned int& unique) const;
// Implementation of item 1-c
string get_most_repeated( int& n_repeated ) const;
vector<int> get_most_repeated_vec( int& n_repeated );
// Implementation of item 1-d
vector<string>& get_invalids();
private:
inline bool is_integer(const std::string &s);
void populate_vector(string line, vector<int>& s);
vector<string> invalid_str;
Node* root;
unsigned int n_duplicated, n_unique;
int most_frequent_n;
string most_frequent;
};
#endif