Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 353
  • Last Modified:

Search Algorithm

A client of mine has asked me to create a search algorithm (I'm not sure yet what the "datasource" I'll be searching against).  I have no idea where to start!!!!  I've never been asked to program an algorithm before.  I want to believe that .net has some algorithm class(es) built into it already that i can leverage.

need any advice or links to information that will get me started.  I have only a few days to let the client know whether I am able to handle his request.
0
davidcahan
Asked:
davidcahan
  • 3
  • 2
  • 2
3 Solutions
 
David RobitailleAnalyst ProgrammerCommented:
well, depending of the class, .net have some function the implements some search algoritms. but it all depends of the input.
What you search?
Where you search (a database?)
What kind of output?
0
 
colonel720Commented:
Assuming its a relational database, you would be using .net's ADO.NET object model (System.Data) to send SQL queries to the database.
The .net framework has the foundation to implement just about anything... however you should ask your client to give you specific details on what you will be searching before you can tell him whether or not you can do it.
0
 
davidcahanAuthor Commented:
very true...i do need more information.  the one thing i'll say is that both of us are programmers and have been for quite some time.  He specifically said "algorithm" and not "query" so I'm assuming he is talking about something more than a simple query.

i just need some advice on where to even start.  I do searches online and don't really find much of what i'm looking for (which would be any information regarding vb.net, sql server and building algorithms).
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
David RobitailleAnalyst ProgrammerCommented:
well, as you know, algorithm are not language depeandant.
Common search algorithme invlove sorted array or more advanced data structure as a binary tree.
.net has a Dictionary class for key/object association.
there is also class like Generic.List that have methods like find, findAll and findFirst
here an exemple for FindAll
http://msdn.microsoft.com/en-us/library/fh1w7y8z.aspx 
0
 
colonel720Commented:
Lets say your client were to ask you to search through a list of stock prices by date and find all date ranges with an average rate of increase greater than some threshold.
This is just an example, but there is no defined algorithm in .net ot in any language to do that - you would need to piece it together using data structures, loops, comparitive operators, etc.

Thats half the fun in programming.. figuring out how to solve a problem using conventional programming tactics.
0
 
davidcahanAuthor Commented:
ok...so really "algorithm" is just a way to say "a routine that searches through data in some systematic way (and hopefully quickly)".  so technically a stored procedure that selects data could be an algorithm?  or inserting items into an array() and then searching through them could be an algorithm?

I probably should have mentioned this beforem, but I do know this about the project:

As an example of what he wanted, He did say something about a search for "red apple" and then results:  100% red apple, 80% green apple, 70% apple, 60% orange, 40% red banana.
0
 
colonel720Commented:
Yes. Whatever routine you end up using to get the end results is the algorithm.
Depending on which data structures you decide to use in the implementation of the algorithm, there may be methods to help you along the way.. as davrob60 mentioned above - certain collection classes have find methods to save you from having to manually loop through them.
As for which data structures to use in your algorithm - thats completely dependent on the problem being solved by it, and what kind of information it needs to process. Deciding that is up to you, the process architect.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now