473,387 Members | 1,742 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,387 software developers and data experts.

ternary tree (ann)

Hi,

I've refreshed my Ternary search tree implementation at
http://abc.se/~re/code/tst/

It should now be usable. It compiles cleanly with Comeau's online compiler,
g++ 3.4.3, and MSVC 7.1. Some tests are included (some tests not portable).
There are wrapper classes that will work as (nearly) drop-in replacements
for set, map, multiset, multimap, or the unordered_* counterparts.
----

Ternary search trees were described by Bentley and Sedgewick
in DDJ 1994/04, see also http://www.cs.princeton.edu/~rs/strings/
for a more theoretical article and C code sketch.

If you don't know about TST's, it's worth checking out,
as it is useful as a dictionary container.
A TST allows advanced key searches, currently:
- prefix match,
- longest match (tokenizing input over the dictionary),
- neighbour search (eg for mispelt words), and
- wildcard search: "b?nd" finds "band", "bend", "bind", "bond", etc.

and it offers lookup speed similar to hash maps.
Some additions will be made in the future (interface for advanced key searches),
but the present state is (I think) not worse than other public versions.

I'd be grateful for comments on interface, docs and implementation.
It's not quite finished, so any suggestions to make it better is appreciated.
Or just use it and mail me on failure (or follow-up in comp.lang.c++).
If someone is interested (and I survive the shock), I could move it
to eg Sourceforge for easier access.
Cheers,

re











Feb 14 '06 #1
0 1762

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

Similar topics

6
by: praba kar | last post by:
Dear All, I am new to Python. I want to know how to work with ternary operator in Python. I cannot find any ternary operator in Python. So Kindly clear my doubt regarding this ...
4
by: Travis Stewart | last post by:
Hi, I am not very familiar with C++ so the problems I am having might be simple and I just cannot see them or I am totally unaware of why something would be incorrect. Anyway, I'm using the ANN...
6
by: glongword | last post by:
As the assert macro should evaluate to a void expression, it should not have an 'if statement' in its definition. Does this necessitate the existence of a ternary conditional operator? Is there a...
7
by: Bonj | last post by:
In making a ternary search tree to identify as fast as possible the type of word passed in to the algorithm, for instance sp_help -> 1 (procedures), select -> 2 (keywords), sysobjects -> 3 (system...
1
by: maryjones11289 | last post by:
Hi All, I'm trying to write/find code that creates a Ternary Search Tree in Visual Basic (VB6 or .NET). Here's my situation: What I have is an array consisting of 60,000 string elements. All...
3
by: Yuri CHUANG | last post by:
Hi, Here is my code, #include<stdio.h> #include<stdlib.h> typedef struct BiTNode { char data; struct BiTNode *lchild,*rchild;
5
by: PerlPhi | last post by:
hi,,, while ago i was wondering why do some programmers rarely uses the ternary operator. wherein it is less typing indeed. i believe in the classic virtue of Perl which is laziness. well let me show...
0
by: YellowFin Announcements | last post by:
Security solutions provider EXTOL MSC Berhad has developed a neural network predictive analysis engine and is now working with Australian business intelligence company Yellowfin to develop a front...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.