473,396 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

compressed suffix trie

Hi all,

I want to build a compressed suffix trie from a string for string
matching.instead of doing like:

input:a string with 10 chars

insert char array 10
insert char array 9,10
insert char array 8,9,10
....
insert char array 1,2,3,4,5,6,7,8,9,10
is there any efficient way to build a trie?
the above method is toooo slow and consum much memory!


Thanks a lot guys
Jul 22 '05 #1
3 4350
Joseph wrote:
I want to build a compressed suffix trie from a string for string
matching.instead of doing like:

input:a string with 10 chars

insert char array 10
insert char array 9,10
insert char array 8,9,10
...
insert char array 1,2,3,4,5,6,7,8,9,10
is there any efficient way to build a trie?
the above method is toooo slow and consum much memory!


char array[11] = {0};
const char * const trie[] = { array + 9, array + 8, ... , array };

Now input your 10 chars in 'array' and use 'trie[5]' to get to
the fifth (sixth) "string".

You can use the same method for dynamically sized string and trie.

Victor
Jul 22 '05 #2
Victor Bazarov <v.********@comAcast.net> wrote in news:ZAi4d.2801$Ae.2102
@newsread1.dllstx09.us.to.verio.net:
Joseph wrote:
I want to build a compressed suffix trie from a string for string
matching.instead of doing like:

input:a string with 10 chars

insert char array 10
insert char array 9,10
insert char array 8,9,10
...
insert char array 1,2,3,4,5,6,7,8,9,10
is there any efficient way to build a trie?
the above method is toooo slow and consum much memory!


char array[11] = {0};
const char * const trie[] = { array + 9, array + 8, ... , array };

Now input your 10 chars in 'array' and use 'trie[5]' to get to
the fifth (sixth) "string".

You can use the same method for dynamically sized string and trie.

Victor


Oh ,sorry ,I mean,is there any faster way to do the compression?
OR a dynamic way ?to do the insertion and compression at same time
Jul 22 '05 #3
Joseph wrote:
Victor Bazarov <v.********@comAcast.net> wrote in news:ZAi4d.2801$Ae.2102
@newsread1.dllstx09.us.to.verio.net:

Joseph wrote:
I want to build a compressed suffix trie from a string for string
matching.instead of doing like:

input:a string with 10 chars

insert char array 10
insert char array 9,10
insert char array 8,9,10
...
insert char array 1,2,3,4,5,6,7,8,9,10
is there any efficient way to build a trie?
the above method is toooo slow and consum much memory!


char array[11] = {0};
const char * const trie[] = { array + 9, array + 8, ... , array };

Now input your 10 chars in 'array' and use 'trie[5]' to get to
the fifth (sixth) "string".

You can use the same method for dynamically sized string and trie.

Victor

Oh ,sorry ,I mean,is there any faster way to do the compression?
OR a dynamic way ?to do the insertion and compression at same time


Oh, sorry, I thought you're asking a C++ language question. You should
find a better place to ask general programming questions, like forum
'comp.programming' or anything related to compression...

V
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Keith Bowes | last post by:
I have a script for requesting HTTP resources and I want it to use HTTP compression (to reduce bandwidth), if possible. What's the best way to do this? I've tried using zlib functions but they...
7
by: Klaus Neuner | last post by:
Hello, I need a function that converts a list into a set of regexes. Like so: string_list = print string_list2regexes(string_list) This should return something like:
8
by: Dennis Hotson | last post by:
Hi, I'm trying to write a function that adds a file-like-object to a compressed tarfile... eg ".tar.gz" or ".tar.bz2" I've had a look at the tarfile module but the append mode doesn't support...
0
by: Polar | last post by:
Hi! Do you know a C library for trie data structures (a particular type of tree)? And some link about trie with C language? Thank you Polar
3
by: Paul | last post by:
Does anyone have an example of a trie data structure implemented in c#? I'm looking for a string trie to use to hold the word list for my spell checker. Any examples or suggestions would be great....
4
by: Pavel | last post by:
Hello. I am trying to make a folder compressed and failing miserably. Below are three ways that I tried to make it compressed, all of them compile and run w/o any problems, but the folder is...
8
by: robert | last post by:
Hello, I want to put (incrementally) changed/new files from a big file tree "directly,compressed and password-only-encrypted" to a remote backup server incrementally via FTP,SFTP or DAV.... At...
0
by: clintp | last post by:
I've seen a few people asking for this elsewhere, so here's a basic implementation of a string trie in C#. I'm using this to load and search a dictionary of about two hundred thousand words. It's...
5
by: iaminsik | last post by:
I implemented a TRIE in memory by myself in C. But, as you know, when a size of data increases, loading time of data becomes longer. I want to implement a TRIE in file, which means division of...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.