Pagini recente » Rating Alex Magdau (magdau33) | Atasamentele paginii Profil silviu_dumitru | Cod sursa (job #1780671) | Diferente pentru trie-forest-based-sort intre reviziile 17 si 18
Nu exista diferente intre titluri.
Diferente intre continut:
h3. The first idea is that if you have a string of length h, you can insert it in a trie of height h. We could maintain a list of tries,
h3. trie H[N], where H[i] is a trie with height i so when we insert a string with lenght i, we insert it in H[i].
h3. trie H[N], where H[i] is a trie with height i so when we insert a string with lengght i, we insert it in H[i].
h3. But what happens when we have, say 2 strings, one of length 3, and one with length 10^20^? We can't declare H[10^20^].
{
for(int i=0; i < n; ++i)
{
if(T->next[a[i]] == 0)
//if I don't have an edge, I creat it
if(T->next[a[i]] == 0) //if I don't have an edge, I create it
{
T->next[a[i]]=new nod;
T->next[a[i]]->nr=0;
{
sol[n]=i;
if(T->next[i]->nr)//has a number ended?
if(T->next[i]->nr)//has a number ended here?
{
for(int j=1; j <= T->next[i]->nr; ++j)
{
Nu exista diferente intre securitate.
Topicul de forum nu a fost schimbat.