473,795 Members | 2,892 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

search algorithms

I am having trouble with creating / finding effective searching algorithms.
I constantly run into a situation where I have a list of objects and need to
find out if a property of one of these objects matches some
criteria...espe cialy if the criteria is a list itself. Example...

class Part has private PartID

A listview of items with each tag having a Part object.
I have an array of PartID's denoting the parts I want to remove from the
list.
The listview has a few hundred thousands records.

when the list is large like this, looping through the list mulltiple times
takes a long time. I am basicaly looking for seom direction on how to think
about developing structures with searching in mind using existing controls.

Thanks in advance
dec
Nov 15 '05 #1
1 2623

and by going through them, he means: do a binary search on
the sorted list. Take a look at the Array class. It has
everything in it. You only need to implement the
IComparable interface in your data class.

Greetings,
BV
-----Original Message-----
Decrypted,

I guess you better sort them first in an order that you feel is better foryour project, and then go through them.
The attached is a list of emails from "Gregory A. Beamer" of differnetmethod of sorting.

Hope it helps.

Sasha

---------

"decrypted" <de*******@eart hlink.net> wrote in message
news:OT******* *******@TK2MSFT NGP09.phx.gbl.. .
I am having trouble with creating / finding effective searching
algorithms.
I constantly run into a situation where I have a list
of objects and needto
find out if a property of one of these objects matches
some criteria...espe cialy if the criteria is a list itself. Example...
class Part has private PartID

A listview of items with each tag having a Part object.
I have an array of PartID's denoting the parts I want to remove from the list.
The listview has a few hundred thousands records.

when the list is large like this, looping through the list mulltiple times takes a long time. I am basicaly looking for seom

direction on how tothink
about developing structures with searching in mind
using existingcontrols.

Thanks in advance
dec


Nov 15 '05 #2

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

Similar topics

22
11124
by: Phlip | last post by:
C++ers: Here's an open ended STL question. What's the smarmiest most templated way to use <string>, <algorithms> etc. to turn this: " able search baker search charlie " into this: " able replace baker replace charlie "
5
2639
by: pembed2003 | last post by:
Hi all, I need to write a function to search and replace part of a char* passed in to the function. I came up with the following: char* search_and_replace(char* source,char search,char* replace){ char* result; size_t l = strlen(source), r = strlen(replace), i; int number_of_replaces = 0; for(i = 0; i < l; i++){ if(source == search)
28
3182
by: joshc | last post by:
If I have an array of data that I know to be sorted in increasing order, and the array is less than 50 elements, and I want to find the first element greater than a certain value, is a simple linear search the best here(for loop from beginning to end of array)? It seems like some other search algorithm like binary or whatever would be of no benefit on this data set.
60
49202
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't be indexed/sorted. I don't want to load the entire file into physical memory, memory-mapped files are ok (and preferred). Speed/performance is a requirement -- the target is to locate the string in 10 seconds or less for a 100 MB file. The...
0
3514
Niheel
by: Niheel | last post by:
A few month's back I ran into this site called "Digg". Of course, by now every techie knows about it. At that time, I was just amazed by the way it worked. Right away it got me thinking, these guys are onto something. Give the power to the users! What I was reading was how this site had given users all the power to moderate and decide what is good for them. The system seemed to work, I would go to my specific categories and I would find...
3
1423
by: lovecreatesbeauty | last post by:
As the most basic algorithms, search and sort my be the most essential things in many software. Does your code have them (or one of them)? What functions in UNIX 6th Edition implement search and sort algorithms? How about their efficiency of those implementations? lovecreatesbeauty
1
1868
by: Harsimrat Singh | last post by:
Hi all the Code Lovers and my developer friends out there. I have a little problem in making good search algorithms in C#. If any one could help me to make a efficient working search engine format in C#, I ll be thankful. Enjoy life and keep Coding!!
19
27654
by: Frank | last post by:
Hello, I have a byte array (byte) and want to search for 3 bytes next to each other containing 0x10, 0x12 and 0x16. Is there some method for that? Thanks Frank
47
3451
by: Henning_Thornblad | last post by:
What can be the cause of the large difference between re.search and grep? This script takes about 5 min to run on my computer: #!/usr/bin/env python import re row="" for a in range(156000): row+="a"
0
9673
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
9522
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
10443
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
10165
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
6783
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();...
0
5437
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...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2921
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.