By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,719 Members | 1,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,719 IT Pros & Developers. It's quick & easy.

Nearest Neighbour / Ternary Search Tree

P: n/a
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 elements are exactly 225 characters in length.
All elements are made up of 1's and 0's

Eg:

1001101001.....
1110111000.....
1101101011.....
Etc
What I'm trying to do:
My aim is to take an arbitrary search key (225 chars in length,
consisting of 1's and 0's) and find all elements in the array where
the hamming distance between the search key and the element is 22 or
less (ie 90% similar).

I could do a brute-force search, but this takes quite some time and is
clearly not optimum.

I have spent the last 3 or so months searching the Internet researching
on the best way to solve this nearest neighbour problem. To date I have
not found anything written in VB. I have found numerous documents that
outline several algorithms, but they have been written in such a way
that I'd need a PHD in something just to understand them.

The latest documentation I have found all indicate that Ternary Search
Trees are the way to go and that implementing a NN search function is
easy with them. The problem is that I cannot find any information on
how to construct the tree. I did find one example written in C, but
with my limited knowledge of C, I was unable to translate into VB.

So now I'm here asking for your assistance please. Can anyone show me
(VB code if possible) how to construct a Ternary Tree as well as the NN
search function or alternatively, point me in the direction of a site
that could help.

Thanks in advance,

Mary.

Jan 9 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ma************@hotmail.com wrote:
Hi All,

I'm trying to write/find code that creates a Ternary Search Tree in
Visual Basic (VB6 or .NET).
So now I'm here asking for your assistance please. Can anyone show me
(VB code if possible) how to construct a Ternary Tree as well as the NN
search function or alternatively, point me in the direction of a site
that could help.
Because you can incorporate C# projects in a VB solution, I offer a C#
solution that you can build as a dll function library. This is complete
downloadable source code.
http://www.thecodeproject.com/csharp...id=31232&exp=0

Tom
Thanks in advance,

Mary.

Jan 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.