473,785 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Searching in B Tree

151 New Member
Can we search a value in B Tree which is less than or greater than a given value instead of searching the value. How?
Thanks in advance.
Mar 21 '09 #1
4 1799
weaknessforcats
9,208 Recognized Expert Moderator Expert
I assume you have Googled this already and found no help?
Mar 22 '09 #2
Man4ish
151 New Member
@weaknessforcats
Yes I googled it but in the B tree only node that is present can only be searched , but i am trying to retrieve the node which has value less than or greater than a given node.
Mar 22 '09 #3
weaknessforcats
9,208 Recognized Expert Moderator Expert
Then you have your answer: You can't search a B tree for a less-than value.

To do that, you need a sorted container. B trees are not sorted.

If you are using C++, create a vector and sort it. Then you can search it for your less than values.

If you are using C, create an array and sort it.
Mar 22 '09 #4
Man4ish
151 New Member
@weaknessforcats
Thank you very much for your answer
Mar 23 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
973
by: MJ | last post by:
Hi, On providing a DirectorySearcher object with a SearchRoot (Root Directory Entry where the search should begin), it is expected to search through the directory tree for objects which qualify as per the 'Filter' provided. I find that it does not traverse through the tree, ging through node and their subnodes but it finds results only in the current node of the directory tree.
2
1792
by: pyguy | last post by:
Hi all, I am running into a conceptual glitch in implementing a simple binary tree class. My insertion and printing (sorting) seems to be ok, but when I search the tree, my find method isn't doing what I thought it should. Here is the output of running my tests: >python -i trees.py ********************************************************************** File "trees.py", line 70, in __main__.BinaryTree.find Failed example:
6
1254
by: yourtrashhere | last post by:
So basically, what I have is a bunch of words in one memo field, for example: dog cat cowboy tree flower To search it, this is the code I have now. ' Check for LIKE Last Name If Me.txtLastName > "" Then varWhere = varWhere & " LIKE """ & Me.txtLastName & "*" * "
8
2388
by: sandeep | last post by:
Our team is developing proxy server(in VC++)which can handle 5000 clients. I have to implement cache part so when ever a new request com from client I have to check the request URL content is in cache of proxy and send to client if it is cache, if it is not there then it have to get data from web server and store in proxy server cache. so i am thinking to use binary tree search(or AVL tree) to search request URL content in cache if it...
15
2137
by: Gigs_ | last post by:
Hi all! I have text file (english-croatian dictionary) with words in it in alphabetical order. This file contains 179999 words in this format: english word: croatian word I want to make instant search for my gui Instant search, i mean that my program search words and show words to user as user type letters.
4
1889
by: jm.suresh | last post by:
Hi, I have a tree data structure and I name each node with the following convention: a |---aa | |--- aaa | |--- aab | |---ab |
1
1439
by: j_depp_99 | last post by:
I would like to know what would be the best way to count the nodes accessed while searching for an item in a binary search tree. I have to keep a tally for each item I search for. I have included my search method from my program. <code/> void BinarySearchTree::find(int d) { //Locate the element bool found = false; if(isEmpty())
4
1604
by: jodleren | last post by:
Hi! I wonder, which way to do this fastest. I have a disk, where I need to search for a file or directory. I do it recursively, meaning that I start from the top dir, then I add all directories to an array, and by a counter I work my way through that array. And, while doing that I add the directory or file (name) to and result
6
1431
by: Gordon | last post by:
I've developed a CMS that manages content across several sites. The content is represented in a tree structure maintained in a database, where each item has an id and a parent that points to the containing item or 0 if it's a root item (a site). I developed a fulltext search script for the CMS that will return pages ordered by relevance. This is fine, but I've now had a change request whereby searches can be restricted to specific...
0
9645
marktang
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...
0
9480
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,...
0
10324
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, 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...
1
10090
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8971
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, 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...
0
5380
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...
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.