-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSequence.h
More file actions
43 lines (40 loc) · 763 Bytes
/
Copy pathSequence.h
File metadata and controls
43 lines (40 loc) · 763 Bytes
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 SEQUENCE_H
#define SEQUENCE_H
#include<stdio.h>
#include<fstream>
#include<iostream>
#include<string>
using namespace std;
#define MAX 400000
int getIndex(char base);
class Sequence{
private:
struct Table{
int common;
string Heads[4];
int cMatchs;
int* cStarts;
Table* Sons[4];
Table(string baseString,int com);
};
private:
ifstream fin;
string s;
string BestString;
Table* Ancestor;
long Num[4];
long Start[4];
long Max[4];
char last;
private:
void Filter(Table* t);
void ReadFile();
void getX(char base);
public:
Sequence(string filename);
int length(){return s.size();}
int numberOf(char base){return Num[getIndex(base)];}
string longestConsecutive();
string longestRepeated();
};
#endif