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. 1 3215 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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: John Hunter |
last post by:
I have a list of two tuples containing x and y coord
(x0, y0)
(x1, y1)
...
(xn, yn)
Given a new point x,y, I would like to find the point in the list
closest to x,y. I have to do this a lot, in an inner loop, and then I
add each new point x,y to the list. I know the range of x and y in
|
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 approximate nearest
neighbour libraries written by David Mount and Sunil Arya. In the ANN.h
file there is a comment describing how the data types used to represent
the coordinates and distances between points can be modified by the user.
For my...
|
by: j |
last post by:
Hi,
Anyone out there with binary search tree experience. Working on a
project due tomorrow and really stuck. We need a function that splits
a binary tree into a bigger one and smaller one(for a random binary
search tree. We've tried everything but are in the land of pointer
hell. If someone could help it would be a huge help. our code follows.
We've tried 2 diff methods the split() and splitter() functions
#include <iostream>
#include...
|
by: Tarique Jawed |
last post by:
Alright I needed some help regarding a removal of a binary search
tree. Yes its for a class, and yes I have tried working on it on my
own, so no patronizing please. I have most of the code working, even
the removal, I just don't know how to keep track of the parent, so
that I can set its child to the child of the node to be removed.
IE - if I had
C
/ \
B D
|
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 tables), I'm stuck on
deciding what type of comparison happens at each node.
Has anyone got any suggestions?
Do you think for the first level I could compare just the first characters
of the word passed in and the word at the 'current' node, or...
| |
by: Mr. Ken |
last post by:
Here are the funny results I got from Dev-C++, what I need is rounding to
nearest integer.
How can I do that in Dev-C++?
a = -1 -1 -1 -1 1 1 2 2 2 1
b = round(a)
-0.729627 -0.9540721 -0.2123411 -0.078923 0.321015 0.9876552 1.123422
1.632136 1.234538 0.765442
c = int(a)
|
by: hn.ft.pris |
last post by:
I have the following code:
Tree.h defines a simple binary search tree node structure
########## FILE Tree.h ################
#ifndef TREE_H
#define TREE_H
//using namespace std;
template <typename Tclass Tree{
private:
Tree<T*left;
|
by: Defected |
last post by:
Hi,
How i can implement a main function with this Binary Search Tree.
thanks for help.
is this code corrected ?
#include<iostream>
|
by: oll3i |
last post by:
When i have DNA test data like the data below just few first rows pasted here
first number is the number of rows and second number is the number of columns 21st column is a decision
1186 21
1 2 3 1 3 3 1 3 3 1 2 0 3 2 1 3 2 1 0 2 3
0 0 2 1 0 0 0 2 1 3 2 1 2 2 1 0 3 1 1 3 2
0 3 1 1 0 2 2 0 1 3 1 3 0 0 2 1 1 3 3 1 2
1 2 3 3 3 1 3 0 3 3 1 2 1 3 3 1 3 0 3 3 3
3 0 1 3 3 2 0 3 3 3 3 1 3 3 1 3 1 0 3 2 3
0 2 0 3 2 1 2 2 1 2 3 0 3 1 3 0 2 2 1 0...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |