Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions daTrie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <string>
#include<fstream>
#include<time.h>
#include<bits/stdc++.h>

using namespace std;
class DoubleArrayTrie
Expand All @@ -18,11 +19,8 @@ class DoubleArrayTrie
size = size_;
base = new int[size];
check = new int[size];
for (int i = 0; i < size; i++)
{
base[i] = 0;
check[i] = 0;
}
memset(base,0,sizeof(base));
memset(check , 0 , sizeof(check));
base[1] = 1;
pos = 1;
tail = "";
Expand Down Expand Up @@ -150,7 +148,7 @@ class DoubleArrayTrie
string str;
for (int i = 0; i < vec.size(); i++)
{
str += val(vec[i]);
str.push_back(val(vec[i]));
}
return str;
}
Expand Down Expand Up @@ -254,7 +252,7 @@ class DoubleArrayTrie
string temp = "";
while (tail[p] != '#')
{
temp = temp + tail[p];
temp = temp.push_back(tail[p]);
p++;
}
temp = temp + "#";
Expand Down